[FFmpeg-cvslog] r26059 - trunk/libavfilter/vf_vflip.c
stefano
subversion
Sun Dec 19 19:17:12 CET 2010
Author: stefano
Date: Sun Dec 19 19:17:11 2010
New Revision: 26059
Log:
Revert commit r22596.
commit ab8610aa176c13b5e25a2d8770df28a14665e169
Author: koorogi <koorogi at 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Date: Thu Mar 18 23:13:04 2010 +0000
The vflip filter does not need to keep ownership of a picture reference.
Avoid creating and releasing useless extra picture references in the
start_frame and end_frame callbacks.
git-svn-id: svn://svn.ffmpeg.org/ffmpeg/trunk at 22596 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
The new reference creation is required when the linesizes are used by the
previous filters in the filterchain, for example as in "pad=W:H:X:Y,vflip".
Modified:
trunk/libavfilter/vf_vflip.c
Modified: trunk/libavfilter/vf_vflip.c
==============================================================================
--- trunk/libavfilter/vf_vflip.c Sun Dec 19 14:02:05 2010 (r26058)
+++ trunk/libavfilter/vf_vflip.c Sun Dec 19 19:17:11 2010 (r26059)
@@ -60,21 +60,22 @@ static AVFilterBufferRef *get_video_buff
return picref;
}
-static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
+static void start_frame(AVFilterLink *link, AVFilterBufferRef *inpicref)
{
FlipContext *flip = link->dst->priv;
+ AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0);
int i;
for (i = 0; i < 4; i ++) {
int vsub = i == 1 || i == 2 ? flip->vsub : 0;
- if (picref->data[i]) {
- picref->data[i] += ((link->h >> vsub)-1) * picref->linesize[i];
- picref->linesize[i] = -picref->linesize[i];
+ if (outpicref->data[i]) {
+ outpicref->data[i] += ((link->h >> vsub)-1) * outpicref->linesize[i];
+ outpicref->linesize[i] = -outpicref->linesize[i];
}
}
- avfilter_start_frame(link->dst->outputs[0], picref);
+ avfilter_start_frame(link->dst->outputs[0], outpicref);
}
static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
@@ -95,7 +96,6 @@ AVFilter avfilter_vf_vflip = {
.get_video_buffer = get_video_buffer,
.start_frame = start_frame,
.draw_slice = draw_slice,
- .end_frame = avfilter_null_end_frame,
.config_props = config_input, },
{ .name = NULL}},
.outputs = (AVFilterPad[]) {{ .name = "default",
More information about the ffmpeg-cvslog
mailing list