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 22e928c..4bead5a 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;