diff options
author | llyyr <llyyr.public@gmail.com> | 2024-01-11 11:00:42 +0530 |
---|---|---|
committer | Niklas Haas <github-daiK1o@haasn.dev> | 2024-01-11 07:05:35 +0100 |
commit | 10321b869f73d8d99543e6723551895e3a7d8ed5 (patch) | |
tree | f118344220572a8de768ad48128be3e094bdb9f9 /filters/f_lavfi.c | |
parent | 4b691641472b487831a0b0f7637d5355d79387cd (diff) | |
download | mpv-10321b869f73d8d99543e6723551895e3a7d8ed5.tar.bz2 mpv-10321b869f73d8d99543e6723551895e3a7d8ed5.tar.xz |
f_lavfi: provide color_space and color_range params for lavfi
Only when the lavfi version is sufficiently new enough to actually have
these fields. See:
https://github.com/FFmpeg/FFmpeg/commit/2d555dc82d4ccd3c54c76e2fb3c861a8652de1c6
Fixes #13234
Diffstat (limited to 'filters/f_lavfi.c')
-rw-r--r-- | filters/f_lavfi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/filters/f_lavfi.c b/filters/f_lavfi.c index fe7d3e4527..df316d6f07 100644 --- a/filters/f_lavfi.c +++ b/filters/f_lavfi.c @@ -492,6 +492,10 @@ static bool init_pads(struct lavfi *c) params->sample_aspect_ratio.den = fmt->params.p_h; params->hw_frames_ctx = fmt->hwctx; params->frame_rate = av_d2q(fmt->nominal_fps, 1000000); +#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(9, 16, 100) + params->color_space = mp_csp_to_avcol_spc(fmt->params.color.space); + params->color_range = mp_csp_levels_to_avcol_range(fmt->params.color.levels); +#endif filter_name = "buffer"; } else { MP_ASSERT_UNREACHABLE(); |