summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-12-19 18:17:11 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-12-19 18:17:11 +0000
commit2609ad3e401294331910415f90aca943e144629e (patch)
treea58ca1cac72d9728b5ada0801ff2e34f68ca0d80 /libavfilter
parent69b8d83ecf5f6deb9ad94bdaa816aa205430d3e9 (diff)
downloadffmpeg-2609ad3e401294331910415f90aca943e144629e.tar.gz
Revert commit r22596.
commit ab8610aa176c13b5e25a2d8770df28a14665e169 Author: koorogi <koorogi@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. Originally committed as revision 22596 to svn://svn.ffmpeg.org/ffmpeg/trunk 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". Originally committed as revision 26059 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_vflip.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavfilter/vf_vflip.c b/libavfilter/vf_vflip.c
index 95d90d39e6..2ff44411b3 100644
--- a/libavfilter/vf_vflip.c
+++ b/libavfilter/vf_vflip.c
@@ -60,21 +60,22 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms,
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",