]> git.sesse.net Git - ffmpeg/commitdiff
lavfi/vf_scale_vaapi: set output SAR
authorRodger Combs <rodger.combs@gmail.com>
Sat, 13 Jan 2018 01:08:27 +0000 (19:08 -0600)
committerRodger Combs <rodger.combs@gmail.com>
Fri, 19 Jan 2018 01:18:33 +0000 (19:18 -0600)
libavfilter/vf_scale_vaapi.c

index 22e928c098871f8ca88d5d6557fe5fa86f2d305b..4bead5aaf4b8832f805af0a0e2d65496f82286ff 100644 (file)
@@ -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;