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

Unified · Split

libavfilter/vf_libplacebo.c+2−2
@@ -1017,7 +1017,7 @@ static int output_frame(AVFilterContext *ctx, int64_t pts) · 1016 unmodified lines
10171017 FilterLink *il = ff_filter_link(ctx->inputs[i]);
10181018 FilterLink *ol = ff_filter_link(outlink);
10191019 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)
10211021 continue;
10221022 opts->params.skip_caching_single_frame = high_fps;
10231023 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
12051205 retry = true;
12061206 break;
12071207 case PL_QUEUE_OK:
1208− ok = true;
1208+ ok |= in->mix.num_frames > 0;
12091209 break;
12101210 case PL_QUEUE_ERR:
12111211 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