X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fvf_dedot.c;h=b79d4a51c465f7aecb4c2a54803af2d9f87ea7ca;hb=6ad61e30a16d338eab23b649365813fb150066ef;hp=bb0f9e5ac8f4f4b51565ef88b3a9de89ea700c4c;hpb=92219ef4ac01b00e630b39cb19e8fbd17fdb63d0;p=ffmpeg diff --git a/libavfilter/vf_dedot.c b/libavfilter/vf_dedot.c index bb0f9e5ac8f..b79d4a51c46 100644 --- a/libavfilter/vf_dedot.c +++ b/libavfilter/vf_dedot.c @@ -71,6 +71,7 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16, AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA444P10, + AV_PIX_FMT_YUVA422P12, AV_PIX_FMT_YUVA444P12, AV_PIX_FMT_YUVA420P16, AV_PIX_FMT_YUVA422P16, AV_PIX_FMT_YUVA444P16, AV_PIX_FMT_NONE }; @@ -283,7 +284,7 @@ static int activate(AVFilterContext *ctx) s->frames[i] = av_frame_clone(frame); } av_frame_free(&frame); - } else { + } else if (s->frames[3]) { s->eof_frames--; s->frames[4] = av_frame_clone(s->frames[3]); } @@ -312,7 +313,8 @@ static int activate(AVFilterContext *ctx) FFMIN(s->planeheight[2], ff_filter_get_nb_threads(ctx))); } - } + } else + av_frame_free(&out); } else if (!out) { ret = AVERROR(ENOMEM); } @@ -343,7 +345,11 @@ static int activate(AVFilterContext *ctx) if (!s->eof && ff_inlink_acknowledge_status(inlink, &status, &pts)) { if (status == AVERROR_EOF) { s->eof = 1; - s->eof_frames = 2; + s->eof_frames = !!s->frames[0] + !!s->frames[1]; + if (s->eof_frames <= 0) { + ff_outlink_set_status(outlink, AVERROR_EOF, pts); + return 0; + } ff_filter_set_ready(ctx, 10); return 0; } @@ -395,7 +401,7 @@ static const AVFilterPad outputs[] = { AVFILTER_DEFINE_CLASS(dedot); -AVFilter ff_vf_dedot = { +const AVFilter ff_vf_dedot = { .name = "dedot", .description = NULL_IF_CONFIG_SMALL("Reduce cross-luminance and cross-color."), .priv_size = sizeof(DedotContext),