This previous expression multiplied a constant (outlink->h) that was guaranteed to be 0 at this point, thus making it always a no-op. Fix the calculation, and also properly reset the SAR to 1:1 as is now necessary (the failure to do so previously hid this bug's existence).
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -582,12 +582,13 @@ static int libplacebo_config_output(AVFilterLink *outlink) · 581 unmodified lines | ||
| 582 | 582 | s->force_original_aspect_ratio, |
| 583 | 583 | s->force_divisible_by); |
| 584 | 584 | |
| 585 | − scale_sar = (AVRational){outlink->h * inlink->w, *out_w * *out_h}; | |
| 585 | + scale_sar = (AVRational){*out_h * inlink->w, *out_w * inlink->h}; | |
| 586 | 586 | if (inlink->sample_aspect_ratio.num) |
| 587 | 587 | scale_sar = av_mul_q(scale_sar, inlink->sample_aspect_ratio); |
| 588 | 588 | |
| 589 | 589 | if (s->normalize_sar) { |
| 590 | 590 | /* Apply all SAR during scaling, so we don't need to set the out SAR */ |
| 591 | + outlink->sample_aspect_ratio = (AVRational){ 1, 1 }; | |
| 591 | 592 | s->target_sar = scale_sar; |
| 592 | 593 | } else { |
| 593 | 594 | /* This is consistent with other scale_* filters, which only |