Compare commits

...

2 Commits

Author SHA1 Message Date
Niklas Haas 08eda05967 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.
2025-11-04 12:38:55 +00:00
Niklas Haas 49452967e7 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: 4f623b4c59
2025-11-04 12:38:55 +00:00
1 changed files with 4 additions and 2 deletions

View File

@ -912,8 +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];
image->rotation = s->rotation;
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);
@ -1150,6 +1151,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;