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

j at svn.xiph.org j at svn.xiph.org
Thu Apr 30 07:21:38 PDT 2009


Author: j
Date: 2009-04-30 07:21:37 -0700 (Thu, 30 Apr 2009)
New Revision: 15969

Modified:
   trunk/ffmpeg2theora/src/ffmpeg2theora.c
   trunk/ffmpeg2theora/src/theorautils.c
Log:
fix encoding without setting end time

Modified: trunk/ffmpeg2theora/src/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/src/ffmpeg2theora.c	2009-04-30 13:34:16 UTC (rev 15968)
+++ trunk/ffmpeg2theora/src/ffmpeg2theora.c	2009-04-30 14:21:37 UTC (rev 15969)
@@ -1023,8 +1023,8 @@
             }
 
             /* check for end time */
-            if (info.audio_only && no_samples > 0) {
-                if (this->sample_count > no_samples) {
+            if (no_samples > 0) {
+                if (this->sample_count >= no_samples) {
                     break;
                 }
             }
@@ -1205,7 +1205,8 @@
                                 audio_p = audio_buf;
                         }
                     }
-                    if (this->sample_count + samples_out > no_samples) {
+
+                    if (this->end_time > 0 && this->sample_count + samples_out > no_samples) {
                         e_o_s = 1;
                         samples_out = no_samples - this->sample_count;
                         if (samples_out <= 0) {

Modified: trunk/ffmpeg2theora/src/theorautils.c
===================================================================
--- trunk/ffmpeg2theora/src/theorautils.c	2009-04-30 13:34:16 UTC (rev 15968)
+++ trunk/ffmpeg2theora/src/theorautils.c	2009-04-30 14:21:37 UTC (rev 15969)
@@ -515,10 +515,8 @@
 
     int i,j, count = 0;
     float **vorbis_buffer;
-    if (bytes <= 0 && samples <= 0) {
-        /* end of audio stream */
-        if (e_o_s)
-            vorbis_analysis_wrote (&info->vd, 0);
+    if (e_o_s) {
+        vorbis_analysis_wrote (&info->vd, 0);
     }
     else{
         vorbis_buffer = vorbis_analysis_buffer (&info->vd, samples);



More information about the commits mailing list