X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fvf_fade.c;h=6d68357e6ac5e74a1547f1fd5e116ede851313b8;hb=b1b84b068d20d29aa9e1c0cc3a989e293138997c;hp=0103ca290fba4239a1225229d7daba5c8989f14c;hpb=85044358f63f0158fb83712f659f6db5b454a7aa;p=ffmpeg diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c index 0103ca290fb..6d68357e6ac 100644 --- a/libavfilter/vf_fade.c +++ b/libavfilter/vf_fade.c @@ -214,7 +214,7 @@ static void fade_plane(int y, int h, int w, } } -static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) +static int draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) { FadeContext *fade = inlink->dst->priv; AVFilterBufferRef *outpic = inlink->cur_buf; @@ -255,20 +255,23 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) } } - ff_draw_slice(inlink->dst->outputs[0], y, h, slice_dir); + return ff_draw_slice(inlink->dst->outputs[0], y, h, slice_dir); } -static void end_frame(AVFilterLink *inlink) +static int end_frame(AVFilterLink *inlink) { FadeContext *fade = inlink->dst->priv; + int ret; - ff_end_frame(inlink->dst->outputs[0]); + ret = ff_end_frame(inlink->dst->outputs[0]); if (fade->frame_index >= fade->start_frame && fade->frame_index <= fade->stop_frame) fade->factor += fade->fade_per_frame; fade->factor = av_clip_uint16(fade->factor); fade->frame_index++; + + return ret; } AVFilter avfilter_vf_fade = { @@ -279,17 +282,17 @@ AVFilter avfilter_vf_fade = { .priv_size = sizeof(FadeContext), .query_formats = query_formats, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_props, - .get_video_buffer = ff_null_get_video_buffer, - .start_frame = ff_null_start_frame, - .draw_slice = draw_slice, - .end_frame = end_frame, - .min_perms = AV_PERM_READ | AV_PERM_WRITE, - .rej_perms = AV_PERM_PRESERVE, }, - { .name = NULL}}, - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, }, - { .name = NULL}}, + .inputs = (const AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_props, + .get_video_buffer = ff_null_get_video_buffer, + .start_frame = ff_null_start_frame, + .draw_slice = draw_slice, + .end_frame = end_frame, + .min_perms = AV_PERM_READ | AV_PERM_WRITE, + .rej_perms = AV_PERM_PRESERVE, }, + { .name = NULL}}, + .outputs = (const AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, }, + { .name = NULL}}, };