History

avfilter/vf_libplacebo: flush render cache when input is invisible

This prevents leaking stale metadata from previous frames, for example if an overlay temporarily obscures this input and then un-obscures it again. It is worth pointing out that this does change the semantics subtly, because of the smoothing period on detected HDR metadata, but I argue that the new behavior is an improvement, as it will avoid leaking past metadata that is definitely no longer relevant after an image is unobscured.

Niklas Haas committed 1 year ago

Commit 62893fb1 parent 3091bca1 file · +3 −1Browse files

Unified · Split

libavfilter/vf_libplacebo.c+3−1
@@ -1049,8 +1049,10 @@ static int output_frame(AVFilterContext *ctx, int64_t pts) · 1048 unmodified lines
10491049 FilterLink *il = ff_filter_link(ctx->inputs[i]);
10501050 FilterLink *ol = ff_filter_link(outlink);
10511051 int high_fps = av_cmp_q(il->frame_rate, ol->frame_rate) >= 0;
1052− if (in->qstatus != PL_QUEUE_OK || !in->mix.num_frames || i < idx_start)
1052+ if (in->qstatus != PL_QUEUE_OK || !in->mix.num_frames || i < idx_start) {
1053+ pl_renderer_flush_cache(in->renderer);
10531054 continue;
1055+ }
10541056 opts->params.skip_caching_single_frame = high_fps;
10551057 update_crops(ctx, in, &target, target_pts);
10561058 pl_render_image_mix(in->renderer, &in->mix, &target, &opts->params);

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