History

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.

Niklas Haas committed 1 year ago

Commit d69ccbf1 parent 62893fb1 file · +4 −9Browse files

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

Unified · Split

libavfilter/vf_libplacebo.c+4−9
@@ -940,7 +940,11 @@ static int output_frame(AVFilterContext *ctx, int64_t pts) · 939 unmodified lines
940940 if (!cropped && cur->repr.alpha == PL_ALPHA_NONE) {
941941 idx_start = i;
942942 nb_visible = 0;
943+ ref = NULL;
943944 }
945+ /* Use first visible input as overall reference */
946+ if (!ref)
947+ ref = ref_frame(&in->mix);
944948 nb_visible++;
945949 }
946950
@@ -948,15 +952,6 @@ static int output_frame(AVFilterContext *ctx, int64_t pts) · 1 unmodified line
948952 * valid nonempty frame mix */
949953 av_assert1(nb_visible > 0);
950954
951− /* Use the first active input as metadata reference */
952− for (int i = 0; i < s->nb_inputs; i++) {
953− const LibplaceboInput *in = &s->inputs[i];
954− if (in->qstatus == PL_QUEUE_OK && (ref = ref_frame(&in->mix)))
955− break;
956− }
957− if (!ref)
958− return 0;
959−
960955 out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
961956 if (!out)
962957 return AVERROR(ENOMEM);

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