avfilter/vf_libplacebo: use the first visible input for metadata
Instead of undconditionally using the first input. This covers the case of one layer fully obscuring another layer, in which case that should become the new "base" layer.
This commit is contained in:
parent
62893fb94e
commit
d69ccbfc18
1 changed files with 4 additions and 9 deletions
|
|
@ -940,7 +940,11 @@ static int output_frame(AVFilterContext *ctx, int64_t pts)
|
|||
if (!cropped && cur->repr.alpha == PL_ALPHA_NONE) {
|
||||
idx_start = i;
|
||||
nb_visible = 0;
|
||||
ref = NULL;
|
||||
}
|
||||
/* Use first visible input as overall reference */
|
||||
if (!ref)
|
||||
ref = ref_frame(&in->mix);
|
||||
nb_visible++;
|
||||
}
|
||||
|
||||
|
|
@ -948,15 +952,6 @@ static int output_frame(AVFilterContext *ctx, int64_t pts)
|
|||
* valid nonempty frame mix */
|
||||
av_assert1(nb_visible > 0);
|
||||
|
||||
/* Use the first active input as metadata reference */
|
||||
for (int i = 0; i < s->nb_inputs; i++) {
|
||||
const LibplaceboInput *in = &s->inputs[i];
|
||||
if (in->qstatus == PL_QUEUE_OK && (ref = ref_frame(&in->mix)))
|
||||
break;
|
||||
}
|
||||
if (!ref)
|
||||
return 0;
|
||||
|
||||
out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
|
||||
if (!out)
|
||||
return AVERROR(ENOMEM);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue