[Ffmpeg-cvslog] r7806 - trunk/libavformat/asf.c

kostya subversion
Fri Feb 2 15:33:25 CET 2007


Author: kostya
Date: Fri Feb  2 15:33:25 2007
New Revision: 7806

Modified:
   trunk/libavformat/asf.c

Log:
Set correct aspect ratio (it's sample aspect, not display aspect)

Patch by Zuxy Meng
(mail = `echo "Zuxy Meng" | tr "[A-Z] " "[a-z]." | sed "s/$/@gmail.com/"`)



Modified: trunk/libavformat/asf.c
==============================================================================
--- trunk/libavformat/asf.c	(original)
+++ trunk/libavformat/asf.c	Fri Feb  2 15:33:25 2007
@@ -482,11 +482,9 @@
         int stream_num= asf->asfid2avid[i];
         if(stream_num>=0 && dar[i].num>0 && dar[i].den>0){
             AVCodecContext *codec= s->streams[stream_num]->codec;
-            codec->sample_aspect_ratio=
-                av_div_q(
-                    dar[i],
-                    (AVRational){codec->width, codec->height}
-                );
+            av_reduce(&codec->sample_aspect_ratio.num,
+                    &codec->sample_aspect_ratio.den,
+                    dar[i].num, dar[i].den, INT_MAX);
 //av_log(NULL, AV_LOG_ERROR, "dar %d:%d sar=%d:%d\n", dar[i].num, dar[i].den, codec->sample_aspect_ratio.num, codec->sample_aspect_ratio.den);
         }
     }




More information about the ffmpeg-cvslog mailing list