diff options
author | Bobby Bingham <uhmmmm@gmail.com> | 2010-03-18 23:13:04 +0000 |
---|---|---|
committer | Bobby Bingham <uhmmmm@gmail.com> | 2010-03-18 23:13:04 +0000 |
commit | 15ba015f71c951aa4e092fbb79113f5573f5df9f (patch) | |
tree | 15c0dad5d36b36863c70396883a60f728419c27a | |
parent | d313e17ab1180fcced3e61736e6e87f3d4f5101e (diff) | |
download | ffmpeg-15ba015f71c951aa4e092fbb79113f5573f5df9f.tar.gz |
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
-rw-r--r-- | libavfilter/vf_vflip.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavfilter/vf_vflip.c b/libavfilter/vf_vflip.c index 9c0e80adf5..7f5299297f 100644 --- a/libavfilter/vf_vflip.c +++ b/libavfilter/vf_vflip.c @@ -63,19 +63,18 @@ static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms, static void start_frame(AVFilterLink *link, AVFilterPicRef *picref) { FlipContext *flip = link->dst->priv; - AVFilterPicRef *ref2 = avfilter_ref_pic(picref, ~0); int i; for (i = 0; i < 4; i ++) { int vsub = i == 1 || i == 2 ? flip->vsub : 0; - if (ref2->data[i]) { - ref2->data[i] += ((link->h >> vsub)-1) * ref2->linesize[i]; - ref2->linesize[i] = -ref2->linesize[i]; + if (picref->data[i]) { + picref->data[i] += ((link->h >> vsub)-1) * picref->linesize[i]; + picref->linesize[i] = -picref->linesize[i]; } } - avfilter_start_frame(link->dst->outputs[0], ref2); + avfilter_start_frame(link->dst->outputs[0], picref); } static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir) @@ -96,6 +95,7 @@ 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", |