void MPEGaudio:: Rewind(void) { Stop(); #ifdef THREADED_AUDIO /* Stop the decode thread */ StopDecoding(); #endif clearrawdata(); decodedframe = 0; currentframe = 0; frags_playing = 0; }
void MPEGaudio:: Stop(void) { if ( valid_stream ) { SDL_LockAudio(); playing = false; SDL_UnlockAudio(); #ifdef THREADED_AUDIO StopDecoding(); #endif } ResetPause(); }
MPEGaudio:: ~MPEGaudio() { #ifdef THREADED_AUDIO /* Stop the decode thread */ StopDecoding(); #endif /* Remove ourselves from the mixer hooks */ Stop(); if ( sdl_audio ) { /* Close up the audio so others may play */ SDL_CloseAudio(); } }
void MPEGaudio:: Skip(float seconds) { #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 }