Index: audio/MPEGaudio.cpp =================================================================== --- audio/MPEGaudio.cpp (revision 391) +++ audio/MPEGaudio.cpp (working copy) @@ -253,14 +253,23 @@ void MPEGaudio:: Skip(float seconds) { - /* Called only when there is no timestamp info in the MPEG */ - printf("Audio: Skipping %f seconds...\n", seconds); - while(seconds > 0) - { - seconds -= (float) samplesperframe / ((float) frequencies[version][frequency]*(1+inputstereo)); - if(!loadheader()) break; - } - } +#ifdef THREADED_AUDIO + /* Stop the decode thread */ + StopDecoding(); +#endif + + /* Called only when there is no timestamp info in the MPEG */ + //printf("Audio: Skipping %f seconds...\n", seconds); + while(seconds > 0) + { + seconds -= (float) samplesperframe / ((float) frequencies[version][frequency]*(1+inputstereo)); + if(!loadheader()) break; + } + +#ifdef THREADED_AUDIO + StartDecoding(); +#endif +} void MPEGaudio:: Volume(int vol) { Index: MPEGstream.cpp =================================================================== --- MPEGstream.cpp (revision 391) +++ MPEGstream.cpp (working copy) @@ -234,7 +234,7 @@ Uint32 len; /* Get new data if necessary */ - if ( data == stop ) { + if ( data >= stop ) { /* try to use the timestamp of the first packet */ if ( ! next_packet(true, (timestamp == -1) || !timestamped) ) { break; @@ -259,13 +259,12 @@ copied += len; pos += len; + SDL_mutexV(mutex); + /* Allow 32-bit aligned short reads? */ if ( ((copied%4) == 0) && short_read ) { break; } - - SDL_mutexV(mutex); - } return(copied); @@ -274,7 +273,7 @@ int MPEGstream::copy_byte(void) { /* Get new data if necessary */ - if ( data == stop ) { + if ( data >= stop ) { if ( ! next_packet() ) { return (-1); }