summaryrefslogtreecommitdiff
path: root/sound.c
diff options
context:
space:
mode:
authornotaz2012-10-05 02:00:26 +0300
committernotaz2012-10-05 02:00:26 +0300
commit40a392b00d8a4b812a61956509f7379ca1f396bc (patch)
tree46fe35352584fb0a56d9c7c05f436e69accea3c7 /sound.c
parent0dfe793b682b16d1d3f3d1973a9498adb0304b0f (diff)
downloadpicogpsp-40a392b00d8a4b812a61956509f7379ca1f396bc.tar.gz
picogpsp-40a392b00d8a4b812a61956509f7379ca1f396bc.tar.bz2
picogpsp-40a392b00d8a4b812a61956509f7379ca1f396bc.zip
make sound reinitable
this will be used for Caanoo overclocking workaround
Diffstat (limited to 'sound.c')
-rw-r--r--sound.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sound.c b/sound.c
index 9b21e6c..5593bbe 100644
--- a/sound.c
+++ b/sound.c
@@ -734,12 +734,18 @@ void sound_exit()
sound_exit_flag = 1;
SDL_CondSignal(sound_cv);
SDL_CloseAudio();
+ SDL_Delay(200);
+ SDL_DestroyMutex(sound_mutex);
+ sound_mutex = NULL;
+ SDL_DestroyCond(sound_cv);
+ sound_cv = NULL;
}
-void init_sound()
+void init_sound(int need_reset)
{
SDL_AudioSpec sound_settings;
+ sound_exit_flag = 0;
#ifdef PSP_BUILD
audio_buffer_size = (audio_buffer_size_number * 1024) + 3072;
#else
@@ -779,7 +785,8 @@ void init_sound()
init_noise_table(noise_table15, 32767, 14);
init_noise_table(noise_table7, 127, 6);
- reset_sound();
+ if (need_reset)
+ reset_sound();
SDL_PauseAudio(0);
}