History

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.

Niklas Haas committed 1 year ago

Commit 6627c8e1 parent e5787471 file · +2 −2Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_libplacebo.c+2−2
@@ -1017,7 +1017,7 @@ static int output_frame(AVFilterContext *ctx, int64_t pts) · 1016 unmodified lines
1017 FilterLink *il = ff_filter_link(ctx->inputs[i]);1017 FilterLink *il = ff_filter_link(ctx->inputs[i]);
1018 FilterLink *ol = ff_filter_link(outlink);1018 FilterLink *ol = ff_filter_link(outlink);
1019 int high_fps = av_cmp_q(il->frame_rate, ol->frame_rate) >= 0;1019 int high_fps = av_cmp_q(il->frame_rate, ol->frame_rate) >= 0;
1020 if (in->qstatus != PL_QUEUE_OK)1020 if (in->qstatus != PL_QUEUE_OK || !in->mix.num_frames)
1021 continue;1021 continue;
1022 opts->params.skip_caching_single_frame = high_fps;1022 opts->params.skip_caching_single_frame = high_fps;
1023 update_crops(ctx, in, &target, out->pts * av_q2d(outlink->time_base));1023 update_crops(ctx, in, &target, out->pts * av_q2d(outlink->time_base));
@@ -1205,7 +1205,7 @@ static int libplacebo_activate(AVFilterContext *ctx) · 181 unmodified lines
1205 retry = true;1205 retry = true;
1206 break;1206 break;
1207 case PL_QUEUE_OK:1207 case PL_QUEUE_OK:
1208 ok = true;1208 ok |= in->mix.num_frames > 0;
1209 break;1209 break;
1210 case PL_QUEUE_ERR:1210 case PL_QUEUE_ERR:
1211 return AVERROR_EXTERNAL;1211 return AVERROR_EXTERNAL;

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