diff options
| author | Franklin Wei <git@fwei.tk> | 2018-01-05 17:30:09 -0500 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2018-01-05 17:47:04 -0500 |
| commit | ee034c61826461ff0f5b6b88eae7174540c58eb2 (patch) | |
| tree | 022d604b2becf076f5188784fdc1a7af10ac6f45 /apps/plugins | |
| parent | 9c090c667806238379987b43c8b1bf8d1edea4fb (diff) | |
| download | rockbox-ee034c61826461ff0f5b6b88eae7174540c58eb2.zip rockbox-ee034c61826461ff0f5b6b88eae7174540c58eb2.tar.gz rockbox-ee034c61826461ff0f5b6b88eae7174540c58eb2.tar.bz2 rockbox-ee034c61826461ff0f5b6b88eae7174540c58eb2.tar.xz | |
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
Diffstat (limited to 'apps/plugins')
| -rw-r--r-- | apps/plugins/sdl/src/audio/rockbox/SDL_rockboxaudio.c | 4 |
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 2df820b..b614f09 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(); } static int ROCKBOXAUD_OpenAudio(_THIS, SDL_AudioSpec *spec) @@ -235,7 +235,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; |