[xiph-commits] r16397 - in trunk/ffmpeg2theora: . src

j at svn.xiph.org j at svn.xiph.org
Sun Aug 2 02:26:05 PDT 2009


Author: j
Date: 2009-08-02 02:26:05 -0700 (Sun, 02 Aug 2009)
New Revision: 16397

Modified:
   trunk/ffmpeg2theora/SConstruct
   trunk/ffmpeg2theora/src/ffmpeg2theora.c
Log:
setup twopass, soft-target and buf-deley in the same order as its done in the example

Modified: trunk/ffmpeg2theora/SConstruct
===================================================================
--- trunk/ffmpeg2theora/SConstruct	2009-08-02 01:15:32 UTC (rev 16396)
+++ trunk/ffmpeg2theora/SConstruct	2009-08-02 09:26:05 UTC (rev 16397)
@@ -107,7 +107,7 @@
    print 'pkg-config >= %s not found.' % pkgconfig_version 
    Exit(1)
 
-XIPH_LIBS="ogg >= 1.1 vorbis vorbisenc theoradec theoraenc"
+XIPH_LIBS="ogg >= 1.1 vorbis vorbisenc theoradec >= 1.1alpha3 theoraenc >= 1.1alpha3"
 
 if not conf.CheckPKG(XIPH_LIBS): 
   print 'some xiph libs are missing, ffmpeg2theora depends on %s' % XIPH_LIBS

Modified: trunk/ffmpeg2theora/src/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/src/ffmpeg2theora.c	2009-08-02 01:15:32 UTC (rev 16396)
+++ trunk/ffmpeg2theora/src/ffmpeg2theora.c	2009-08-02 09:26:05 UTC (rev 16397)
@@ -1026,17 +1026,6 @@
                     info.speed_level = max_speed_level;
                 th_encode_ctl(info.td, TH_ENCCTL_SET_SPLEVEL, &info.speed_level, sizeof(int));
             }
-            if(info.passno!=1 && this->buf_delay >= 0){
-                int arg = this->buf_delay;
-                ret = th_encode_ctl(info.td, TH_ENCCTL_SET_RATE_BUFFER,
-                                    &this->buf_delay, sizeof(this->buf_delay));
-                if (this->buf_delay != arg)
-                    fprintf(stderr, "Warning: could not set desired buffer delay of %d, using %d instead.\n",
-                                    arg, this->buf_delay);
-                if(ret < 0){
-                    fprintf(stderr, "Warning: could not set desired buffer delay.\n");
-                }
-            }
             /* setting just the granule shift only allows power-of-two keyframe
                spacing.  Set the actual requested spacing. */
             ret = th_encode_ctl(info.td, TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE,
@@ -1044,6 +1033,7 @@
             if(ret<0){
                 fprintf(stderr,"Could not set keyframe interval to %d.\n",(int)this->keyint);
             }
+
             if(this->soft_target){
               /* reverse the rate control flags to favor a 'long time' strategy */
               int arg = TH_RATECTL_CAP_UNDERFLOW;
@@ -1103,6 +1093,17 @@
                 }
               }
             }
+            if(info.passno!=1 && this->buf_delay >= 0){
+                int arg = this->buf_delay;
+                ret = th_encode_ctl(info.td, TH_ENCCTL_SET_RATE_BUFFER,
+                                    &this->buf_delay, sizeof(this->buf_delay));
+                if (this->buf_delay != arg)
+                    fprintf(stderr, "Warning: could not set desired buffer delay of %d, using %d instead.\n",
+                                    arg, this->buf_delay);
+                if(ret < 0){
+                    fprintf(stderr, "Warning: could not set desired buffer delay.\n");
+                }
+            }
 
         }
         /* audio settings here */



More information about the commits mailing list