Browse code

vf_scale: apply the same transform to the aspect during init that is applied per frame

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2011/08/27 08:49:55
Showing 1 changed files
... ...
@@ -240,6 +240,11 @@ static int config_props(AVFilterLink *outlink)
240 240
     if (!scale->sws)
241 241
         return AVERROR(EINVAL);
242 242
 
243
+    if (inlink->sample_aspect_ratio.num){
244
+        outlink->sample_aspect_ratio = av_mul_q((AVRational){outlink->h * inlink->w, outlink->w * inlink->h}, inlink->sample_aspect_ratio);
245
+    } else
246
+        outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
247
+
243 248
     return 0;
244 249
 
245 250
 fail: