[xiph-commits] r16878 - trunk/ffmpeg2theora/src

j at svn.xiph.org j at svn.xiph.org
Sat Feb 6 22:08:56 PST 2010


Author: j
Date: 2010-02-06 22:08:51 -0800 (Sat, 06 Feb 2010)
New Revision: 16878

Modified:
   trunk/ffmpeg2theora/src/ffmpeg2theora.c
Log:
do not try to get aspect information from source twice in twopass mode, fixes bug reported by DuClare

Modified: trunk/ffmpeg2theora/src/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/src/ffmpeg2theora.c	2010-02-06 15:41:01 UTC (rev 16877)
+++ trunk/ffmpeg2theora/src/ffmpeg2theora.c	2010-02-07 06:08:51 UTC (rev 16878)
@@ -766,25 +766,27 @@
                 this->framerate_new = vstream_fps;
         }
 
-        if (sample_aspect_ratio.num!=0 && this->frame_aspect.num==0) {
+        if (info.twopass!=3 || info.passno==1) {
+            if (sample_aspect_ratio.num!=0 && this->frame_aspect.num==0) {
 
-            // just use the ratio from the input
-            this->aspect_numerator=sample_aspect_ratio.num;
-            this->aspect_denominator=sample_aspect_ratio.den;
-            // or we use ratio for the output
-            if (this->picture_height) {
-                int width=display_width-this->frame_leftBand-this->frame_rightBand;
-                int height=display_height-this->frame_topBand-this->frame_bottomBand;
-                av_reduce(&this->aspect_numerator,&this->aspect_denominator,
-                vstream->sample_aspect_ratio.num*width*this->picture_height,
-                vstream->sample_aspect_ratio.den*height*this->picture_width,10000);
-                frame_aspect=(float)(this->aspect_numerator*this->picture_width)/
-                                (this->aspect_denominator*this->picture_height);
+                // just use the ratio from the input
+                this->aspect_numerator=sample_aspect_ratio.num;
+                this->aspect_denominator=sample_aspect_ratio.den;
+                // or we use ratio for the output
+                if (this->picture_height) {
+                    int width=display_width-this->frame_leftBand-this->frame_rightBand;
+                    int height=display_height-this->frame_topBand-this->frame_bottomBand;
+                    av_reduce(&this->aspect_numerator,&this->aspect_denominator,
+                    vstream->sample_aspect_ratio.num*width*this->picture_height,
+                    vstream->sample_aspect_ratio.den*height*this->picture_width,10000);
+                    frame_aspect=(float)(this->aspect_numerator*this->picture_width)/
+                                    (this->aspect_denominator*this->picture_height);
+                }
+                else{
+                    frame_aspect=(float)(this->aspect_numerator*display_width)/
+                                    (this->aspect_denominator*display_height);
+                }
             }
-            else{
-                frame_aspect=(float)(this->aspect_numerator*display_width)/
-                                (this->aspect_denominator*display_height);
-            }
         }
 
         //pixel aspect ratio set, use that



More information about the commits mailing list