You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avfilter/vf_libplacebo: skip empty inputs
It is possible for pl_queue_update() to return PL_QUEUE_OK, but to generate an empty frame mix. This happens if the first frame of that input is in the future. In this case, we should skip an input as not active, similar to inputs that have already reached EOF.
This commit is contained in:
@@ -1017,7 +1017,7 @@ static int output_frame(AVFilterContext *ctx, int64_t pts)
|
|||||||
FilterLink *il = ff_filter_link(ctx->inputs[i]);
|
FilterLink *il = ff_filter_link(ctx->inputs[i]);
|
||||||
FilterLink *ol = ff_filter_link(outlink);
|
FilterLink *ol = ff_filter_link(outlink);
|
||||||
int high_fps = av_cmp_q(il->frame_rate, ol->frame_rate) >= 0;
|
int high_fps = av_cmp_q(il->frame_rate, ol->frame_rate) >= 0;
|
||||||
if (in->qstatus != PL_QUEUE_OK)
|
if (in->qstatus != PL_QUEUE_OK || !in->mix.num_frames)
|
||||||
continue;
|
continue;
|
||||||
opts->params.skip_caching_single_frame = high_fps;
|
opts->params.skip_caching_single_frame = high_fps;
|
||||||
update_crops(ctx, in, &target, out->pts * av_q2d(outlink->time_base));
|
update_crops(ctx, in, &target, out->pts * av_q2d(outlink->time_base));
|
||||||
@@ -1205,7 +1205,7 @@ static int libplacebo_activate(AVFilterContext *ctx)
|
|||||||
retry = true;
|
retry = true;
|
||||||
break;
|
break;
|
||||||
case PL_QUEUE_OK:
|
case PL_QUEUE_OK:
|
||||||
ok = true;
|
ok |= in->mix.num_frames > 0;
|
||||||
break;
|
break;
|
||||||
case PL_QUEUE_ERR:
|
case PL_QUEUE_ERR:
|
||||||
return AVERROR_EXTERNAL;
|
return AVERROR_EXTERNAL;
|
||||||
|
Reference in New Issue
Block a user