vf_scale: apply the same transform to the aspect during init that is applied per...
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 26 Aug 2011 23:49:55 +0000 (01:49 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 27 Aug 2011 00:04:37 +0000 (02:04 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/vf_scale.c

index 044b284..5cc9e9e 100644 (file)
@@ -240,6 +240,11 @@ static int config_props(AVFilterLink *outlink)
     if (!scale->sws)
         return AVERROR(EINVAL);
 
+    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;
+
     return 0;
 
 fail: