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.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -1017,7 +1017,7 @@ static int output_frame(AVFilterContext *ctx, int64_t pts) · 1016 unmodified lines | ||
| 1017 | 1017 | FilterLink *il = ff_filter_link(ctx->inputs[i]); |
| 1018 | 1018 | FilterLink *ol = ff_filter_link(outlink); |
| 1019 | 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 | 1021 | continue; |
| 1022 | 1022 | opts->params.skip_caching_single_frame = high_fps; |
| 1023 | 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 | 1205 | retry = true; |
| 1206 | 1206 | break; |
| 1207 | 1207 | case PL_QUEUE_OK: |
| 1208 | − ok = true; | |
| 1208 | + ok |= in->mix.num_frames > 0; | |
| 1209 | 1209 | break; |
| 1210 | 1210 | case PL_QUEUE_ERR: |
| 1211 | 1211 | return AVERROR_EXTERNAL; |