History

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

Bobby Bingham committed 16 years ago

Commit 15ba0151 parent d313e171 file · +5 −5Browse files

Unified · Split

libavfilter/vf_vflip.c+5−5
@@ -63,19 +63,18 @@ static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms, · 62 unmodified lines
6363 static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
6464 {
6565 FlipContext *flip = link->dst->priv;
66− AVFilterPicRef *ref2 = avfilter_ref_pic(picref, ~0);
6766 int i;
6867
6968 for (i = 0; i < 4; i ++) {
7069 int vsub = i == 1 || i == 2 ? flip->vsub : 0;
7170
72− if (ref2->data[i]) {
73− ref2->data[i] += ((link->h >> vsub)-1) * ref2->linesize[i];
74− ref2->linesize[i] = -ref2->linesize[i];
71+ if (picref->data[i]) {
72+ picref->data[i] += ((link->h >> vsub)-1) * picref->linesize[i];
73+ picref->linesize[i] = -picref->linesize[i];
7574 }
7675 }
7776
78− avfilter_start_frame(link->dst->outputs[0], ref2);
77+ avfilter_start_frame(link->dst->outputs[0], picref);
7978 }
8079
8180 static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
@@ -96,6 +95,7 @@ AVFilter avfilter_vf_vflip = { · 14 unmodified lines
9695 .get_video_buffer = get_video_buffer,
9796 .start_frame = start_frame,
9897 .draw_slice = draw_slice,
98+ .end_frame = avfilter_null_end_frame,
9999 .config_props = config_input, },
100100 { .name = NULL}},
101101 .outputs = (AVFilterPad[]) {{ .name = "default",

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t