History

avfilter/vf_scale: set correct AVFrame SAR if reset_sar=1

This otherwise generates an inconsistency between the frame state and the link state, since the link state is set to 1:1 explicitly when `reset_sar` is enabled, but this line of code unconditionally overwrote the output frame SAR with the value that would be computed in the absence of `reset_sar`. cf. vf_scale_cuda, which does this correctly

Niklas Haas committed 1 year ago

Commit 04ceabe1 parent e6fb8f31 file · +8 −4Browse files

Unified · Split

libavfilter/vf_scale.c+8−4
@@ -854,10 +854,14 @@ scale: · 853 unmodified lines
854 AV_SIDE_DATA_PROP_COLOR_DEPENDENT);854 AV_SIDE_DATA_PROP_COLOR_DEPENDENT);
855 }855 }
856 856
857 av_reduce(&out->sample_aspect_ratio.num, &out->sample_aspect_ratio.den,857 if (scale->reset_sar) {
858 (int64_t)in->sample_aspect_ratio.num * outlink->h * link->w,858 out->sample_aspect_ratio = outlink->sample_aspect_ratio;
859 (int64_t)in->sample_aspect_ratio.den * outlink->w * link->h,859 } else {
860 INT_MAX);860 av_reduce(&out->sample_aspect_ratio.num, &out->sample_aspect_ratio.den,
861 (int64_t)in->sample_aspect_ratio.num * outlink->h * link->w,
862 (int64_t)in->sample_aspect_ratio.den * outlink->w * link->h,
863 INT_MAX);
864 }
861 865
862 if (sws_is_noop(out, in)) {866 if (sws_is_noop(out, in)) {
863 av_frame_free(&out);867 av_frame_free(&out);

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