History

avfilter/vf_libplacebo: fix normalize_sar calculation

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).

Niklas Haas committed 3 years ago

Commit 46a4cc41 parent 05d39081 file · +2 −1Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_libplacebo.c+2−1
@@ -582,12 +582,13 @@ static int libplacebo_config_output(AVFilterLink *outlink) · 581 unmodified lines
582582 s->force_original_aspect_ratio,
583583 s->force_divisible_by);
584584
585− scale_sar = (AVRational){outlink->h * inlink->w, *out_w * *out_h};
585+ scale_sar = (AVRational){*out_h * inlink->w, *out_w * inlink->h};
586586 if (inlink->sample_aspect_ratio.num)
587587 scale_sar = av_mul_q(scale_sar, inlink->sample_aspect_ratio);
588588
589589 if (s->normalize_sar) {
590590 /* Apply all SAR during scaling, so we don't need to set the out SAR */
591+ outlink->sample_aspect_ratio = (AVRational){ 1, 1 };
591592 s->target_sar = scale_sar;
592593 } else {
593594 /* This is consistent with other scale_* filters, which only

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