PR #20831 opened by Niklas Haas (haasn) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20831 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20831.patch
This is a regression introduced by the addition of the rotation option, which overrode the existing rotation attribute that may have been set to the image. To fix it, add the rotation istead of setting it - however we have to do this directly when mapping, so as to not add it multiple times. Fixes: 4f623b4c59 >From c42c4cd665d0d79b7ffe3d5a668fbccd8898c905 Mon Sep 17 00:00:00 2001 From: Niklas Haas <[email protected]> Date: Mon, 3 Nov 2025 18:18:33 +0100 Subject: [PATCH 1/2] avfilter/vf_libplacebo: don't override existing rotation attribute This is a regression introduced by the addition of the rotation option, which overrode the existing rotation attribute that may have been set to the image. To fix it, add the rotation istead of setting it - however we have to do this directly when mapping, so as to not add it multiple times. Fixes: 4f623b4c59c3c838f588e9def7b59dcc26dee7b9 --- libavfilter/vf_libplacebo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index 87d00519c3..393a0126c1 100644 --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -912,7 +912,6 @@ static void update_crops(AVFilterContext *ctx, LibplaceboInput *in, image->crop.y0 = av_expr_eval(s->crop_y_pexpr, s->var_values, NULL); image->crop.x1 = image->crop.x0 + s->var_values[VAR_CROP_W]; image->crop.y1 = image->crop.y0 + s->var_values[VAR_CROP_H]; - image->rotation = s->rotation; if (s->rotation % PL_ROTATION_180 == PL_ROTATION_90) { /* Libplacebo expects the input crop relative to the actual frame * dimensions, so un-transpose them here */ @@ -1150,6 +1149,7 @@ static bool map_frame(pl_gpu gpu, pl_tex *tex, )); out->lut = s->lut; out->lut_type = s->lut_type; + out->rotation += s->rotation; if (!s->apply_filmgrain) out->film_grain.type = PL_FILM_GRAIN_NONE; -- 2.49.1 >From 9c6ffeaa08583d1b4d3f325876e4d16f9061bdaa Mon Sep 17 00:00:00 2001 From: Niklas Haas <[email protected]> Date: Mon, 3 Nov 2025 18:23:31 +0100 Subject: [PATCH 2/2] avfilter/vf_libplacebo: make rotation check more robust This currently does not make any difference, but it makes the check more robust against possible future changes to the rotation parameter. --- libavfilter/vf_libplacebo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index 393a0126c1..42501c51f2 100644 --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -912,7 +912,9 @@ static void update_crops(AVFilterContext *ctx, LibplaceboInput *in, image->crop.y0 = av_expr_eval(s->crop_y_pexpr, s->var_values, NULL); image->crop.x1 = image->crop.x0 + s->var_values[VAR_CROP_W]; image->crop.y1 = image->crop.y0 + s->var_values[VAR_CROP_H]; - if (s->rotation % PL_ROTATION_180 == PL_ROTATION_90) { + + const pl_rotation rot_total = image->rotation - target->rotation; + if ((rot_total + PL_ROTATION_360) % PL_ROTATION_180 == PL_ROTATION_90) { /* Libplacebo expects the input crop relative to the actual frame * dimensions, so un-transpose them here */ FFSWAP(float, image->crop.x0, image->crop.y0); -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
