summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2018-01-05 17:30:09 -0500
committerFranklin Wei <git@fwei.tk>2018-01-15 19:47:49 -0500
commitef373c03b96b0be08babca581d9f10bccfd4931f (patch)
treeb0eae348c1f5e49dc609ff843bfb4228a0e1ace1
parentbeaeb28a29e44326408df68274999ea6dcd8da07 (diff)
downloadrockbox-ef373c0.tar.gz
rockbox-ef373c0.tar.bz2
rockbox-ef373c0.zip
sdl: clean up audio driver
This prevents a (highly improbable) race condition when exiting, and uses pcm_set_frequency() instead of mixer_set_frequency(), since that seems like the Right Thing to Do (TM). Change-Id: Icb6a4597843215f08b3835490ac63f67c9a04736
-rw-r--r--apps/plugins/sdl/src/audio/rockbox/SDL_rockboxaudio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/plugins/sdl/src/audio/rockbox/SDL_rockboxaudio.c b/apps/plugins/sdl/src/audio/rockbox/SDL_rockboxaudio.c
index 83bd0afb42..1c2e4b2de9 100644
--- a/apps/plugins/sdl/src/audio/rockbox/SDL_rockboxaudio.c
+++ b/apps/plugins/sdl/src/audio/rockbox/SDL_rockboxaudio.c
@@ -211,6 +211,7 @@ static Uint8 *ROCKBOXAUD_GetAudioBuf(_THIS)
static void ROCKBOXAUD_CloseAudio(_THIS)
{
+ rb->pcm_play_stop();
if ( this->hidden->mixbuf != NULL ) {
SDL_FreeAudioMem(this->hidden->mixbuf);
this->hidden->mixbuf = NULL;
@@ -221,7 +222,6 @@ static void ROCKBOXAUD_CloseAudio(_THIS)
if(this->hidden->rb_buf[i])
SDL_FreeAudioMem(this->hidden->rb_buf[i]);
}
- rb->pcm_play_stop();
rb->pcm_set_frequency(HW_SAMPR_DEFAULT);
}
@@ -236,7 +236,7 @@ static int ROCKBOXAUD_OpenAudio(_THIS, SDL_AudioSpec *spec)
SDL_CalculateAudioSpec(spec);
LOGF("samplerate %d", spec->freq);
- rb->mixer_set_frequency(spec->freq);
+ rb->pcm_set_frequency(spec->freq);
/* Allocate mixing buffer */
this->hidden->mixlen = spec->size;