[FFmpeg-soc] [soc]: r1631 - libavfilter/vf_scale.c

koorogi subversion at mplayerhq.hu
Fri Dec 21 08:22:59 CET 2007


Author: koorogi
Date: Fri Dec 21 08:22:58 2007
New Revision: 1631

Log:
fix the aspect ratio calculation for vf_scale


Modified:
   libavfilter/vf_scale.c

Modified: libavfilter/vf_scale.c
==============================================================================
--- libavfilter/vf_scale.c	(original)
+++ libavfilter/vf_scale.c	Fri Dec 21 08:22:58 2007
@@ -115,8 +115,11 @@ static void start_frame(AVFilterLink *li
     out->outpic      = avfilter_get_video_buffer(out, AV_PERM_WRITE);
     out->outpic->pts = picref->pts;
 
-    out->outpic->pixel_aspect.num = picref->pixel_aspect.num * out->h;
-    out->outpic->pixel_aspect.den = picref->pixel_aspect.den * out->w;
+    out->outpic->pixel_aspect.num = picref->pixel_aspect.num * out->h * link->w;
+    out->outpic->pixel_aspect.den = picref->pixel_aspect.den * out->w * link->h;
+    av_reduce(&out->outpic->pixel_aspect.num, &out->outpic->pixel_aspect.den,
+               out->outpic->pixel_aspect.num,  out->outpic->pixel_aspect.den,
+         FFMAX(out->outpic->pixel_aspect.num,  out->outpic->pixel_aspect.den));
 
     avfilter_start_frame(out, avfilter_ref_pic(out->outpic, ~0));
 }



More information about the FFmpeg-soc mailing list