Package: libsmpeg0
Version: 0.4.5+cvs20030824

Tiny mp3 files get truncated at the beginning because the first frame is
read to get information about the bitstream, but is never played.

Patch included.

(also, there are minor valgrind flaws that the patch fixes)

--
krys
diff --exclude configure.in --exclude Makefile.in -r -b -u 
smpeg-0.4.5+cvs20030824-orig/audio/MPEGaudio.cpp 
smpeg-0.4.5+cvs20030824/audio/MPEGaudio.cpp
--- smpeg-0.4.5+cvs20030824-orig/audio/MPEGaudio.cpp    2002-06-08 
11:53:51.000000000 +0200
+++ smpeg-0.4.5+cvs20030824/audio/MPEGaudio.cpp 2005-07-18 18:14:18.000000000 
+0200
@@ -26,12 +26,14 @@
 
 MPEGaudio:: MPEGaudio(MPEGstream *stream, bool initSDL) : sdl_audio(initSDL)
 {
+    /* Just be paranoid.  If all goes well, this will be set to true */
+    valid_stream = false;
+
     /* Initialize MPEG audio */
     mpeg = stream;
     initialize();
 
-    /* Just be paranoid.  If all goes well, this will be set to true */
-    valid_stream = false;
+    MPEGstream_marker *begin_mark = mpeg->new_marker(0);
 
     /* Analyze the MPEG audio stream */
     if ( loadheader() ) {
@@ -51,6 +53,9 @@
                 samplesperframe *= 3;
             }
         }
+
+        mpeg->seek_marker(begin_mark);
+
         if ( sdl_audio ) {
             /* Open the audio, get actual audio hardware format and convert */
             bool audio_active;
@@ -69,6 +74,8 @@
         Volume(100);
     }
 
+    mpeg->delete_marker(begin_mark);
+
     /* For using system timestamp */
     for (int i=0; i<N_TIMESTAMPS; i++)
       timestamp[i] = -1;
diff --exclude configure.in --exclude Makefile.in -r -b -u 
smpeg-0.4.5+cvs20030824-orig/audio/mpeglayer3.cpp 
smpeg-0.4.5+cvs20030824/audio/mpeglayer3.cpp
--- smpeg-0.4.5+cvs20030824-orig/audio/mpeglayer3.cpp   2000-09-21 
20:13:47.000000000 +0200
+++ smpeg-0.4.5+cvs20030824/audio/mpeglayer3.cpp        2005-07-18 
16:02:19.000000000 +0200
@@ -335,6 +335,7 @@
       gi->region0_count   =getbits(4);
       gi->region1_count   =getbits(3);
       gi->block_type      =0;
+      gi->mixed_block_flag=0;
     }
     gi->scalefac_scale    =getbit();
     gi->count1table_select=getbit();

Reply via email to