X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fvf_blackframe.c;h=16b2870d5e19fc8f867bffc24477ccd2346276f9;hb=7a72695c05f12f21a62dc99fa64d1726fc11b236;hp=b37bc035c78a48acae088c216b86359cc91955ea;hpb=15f8941108c5372862035ce8e3cbfd2a6cefb241;p=ffmpeg diff --git a/libavfilter/vf_blackframe.c b/libavfilter/vf_blackframe.c index b37bc035c78..16b2870d5e1 100644 --- a/libavfilter/vf_blackframe.c +++ b/libavfilter/vf_blackframe.c @@ -53,7 +53,7 @@ static int query_formats(AVFilterContext *ctx) return 0; } -static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +static av_cold int init(AVFilterContext *ctx, const char *args) { BlackFrameContext *blackframe = ctx->priv; @@ -66,7 +66,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) if (args) sscanf(args, "%u:%u", &blackframe->bamount, &blackframe->bthresh); - av_log(ctx, AV_LOG_INFO, "bamount:%u bthresh:%u\n", + av_log(ctx, AV_LOG_VERBOSE, "bamount:%u bthresh:%u\n", blackframe->bamount, blackframe->bthresh); if (blackframe->bamount > 100 || blackframe->bthresh > 255) { @@ -77,7 +77,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) return 0; } -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) { AVFilterContext *ctx = inlink->dst; BlackFrameContext *blackframe = ctx->priv; @@ -91,10 +91,10 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) p += picref->linesize[0]; } - ff_draw_slice(ctx->outputs[0], y, h, slice_dir); + return ff_draw_slice(ctx->outputs[0], y, h, slice_dir); } -static void end_frame(AVFilterLink *inlink) +static int end_frame(AVFilterLink *inlink) { AVFilterContext *ctx = inlink->dst; BlackFrameContext *blackframe = ctx->priv; @@ -114,8 +114,7 @@ static void end_frame(AVFilterLink *inlink) blackframe->frame++; blackframe->nblack = 0; - avfilter_unref_buffer(picref); - ff_end_frame(inlink->dst->outputs[0]); + return ff_end_frame(inlink->dst->outputs[0]); } AVFilter avfilter_vf_blackframe = { @@ -127,13 +126,13 @@ AVFilter avfilter_vf_blackframe = { .query_formats = query_formats, - .inputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .draw_slice = draw_slice, - .get_video_buffer = ff_null_get_video_buffer, - .start_frame = ff_null_start_frame_keep_ref, - .end_frame = end_frame, }, - { .name = NULL}}, + .inputs = (const AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .draw_slice = draw_slice, + .get_video_buffer = ff_null_get_video_buffer, + .start_frame = ff_null_start_frame, + .end_frame = end_frame, }, + { .name = NULL}}, .outputs = (const AVFilterPad[]) {{ .name = "default", .type = AVMEDIA_TYPE_VIDEO },