[FFmpeg-devel] [PATCH] lavfi/vf_scale_vaapi: set output SAR

Rodger Combs rodger.combs at gmail.com
Sat Jan 13 03:08:31 EET 2018


---
 libavfilter/vf_scale_vaapi.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavfilter/vf_scale_vaapi.c b/libavfilter/vf_scale_vaapi.c
index 22e928c..4bead5a 100644
--- a/libavfilter/vf_scale_vaapi.c
+++ b/libavfilter/vf_scale_vaapi.c
@@ -240,6 +240,11 @@ static int scale_vaapi_config_output(AVFilterLink *outlink)
         goto fail;
     }
 
+    if (inlink->sample_aspect_ratio.num)
+        outlink->sample_aspect_ratio = av_mul_q((AVRational){outlink->h * inlink->w, outlink->w * inlink->h}, inlink->sample_aspect_ratio);
+    else
+        outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
+
     av_freep(&hwconfig);
     av_hwframe_constraints_free(&constraints);
     return 0;
-- 
2.6.4



More information about the ffmpeg-devel mailing list