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

Unified · Split

libavfilter/vf_libplacebo.c+4−9
@@ -940,7 +940,11 @@ static int output_frame(AVFilterContext *ctx, int64_t pts) · 939 unmodified lines
940 if (!cropped && cur->repr.alpha == PL_ALPHA_NONE) {940 if (!cropped && cur->repr.alpha == PL_ALPHA_NONE) {
941 idx_start = i;941 idx_start = i;
942 nb_visible = 0;942 nb_visible = 0;
943 ref = NULL;
943 }944 }
945 /* Use first visible input as overall reference */
946 if (!ref)
947 ref = ref_frame(&in->mix);
944 nb_visible++;948 nb_visible++;
945 }949 }
946 950
@@ -948,15 +952,6 @@ static int output_frame(AVFilterContext *ctx, int64_t pts) · 1 unmodified line
948 * valid nonempty frame mix */952 * valid nonempty frame mix */
949 av_assert1(nb_visible > 0);953 av_assert1(nb_visible > 0);
950 954
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
960 out = ff_get_video_buffer(outlink, outlink->w, outlink->h);955 out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
961 if (!out)956 if (!out)
962 return AVERROR(ENOMEM);957 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