diff --git a/src/sd-sdl/sound.c b/src/sd-sdl/sound.c index f5daf60..9fbd5e2 100644 --- a/src/sd-sdl/sound.c +++ b/src/sd-sdl/sound.c @@ -174,6 +174,10 @@ void close_sound (void) uae_sem_destroy (&sound_init_sem); uae_sem_destroy (&callback_done_sem); have_sound = 0; + + #ifdef DRIVESOUND + driveclick_free(); + #endif } int init_sound (void) @@ -195,13 +199,20 @@ int init_sound (void) void pause_sound (void) { - SDL_PauseAudio (1); + + SDL_PauseAudio (1); + clearbuffer(); + if (in_callback) { + closing_sound = 1; + uae_sem_post (&data_available_sem); + } } void resume_sound (void) { clearbuffer(); SDL_PauseAudio (0); + closing_sound = 0; } void reset_sound (void) diff --git a/src/sd-sdl/sound.h b/src/sd-sdl/sound.h index a92f49a..9c2d482 100644 --- a/src/sd-sdl/sound.h +++ b/src/sd-sdl/sound.h @@ -18,7 +18,8 @@ extern void resume_sound (void); extern void pause_sound (void); extern void reset_sound (void); extern void driveclick_mix(uae_s16*, int); //Also defined in driveclick.h -extern void driveclick_init(void); +extern void driveclick_init(void); //Also defined in driveclick.h +extern void driveclick_free(void); //Also defined in driveclick.h STATIC_INLINE void check_sound_buffers (void) {