diff options
-rw-r--r-- | backends/sdl/sdl-common.cpp | 4 | ||||
-rw-r--r-- | backends/sdl/sdl-common.h | 2 | ||||
-rw-r--r-- | common/system.h | 7 |
3 files changed, 13 insertions, 0 deletions
diff --git a/backends/sdl/sdl-common.cpp b/backends/sdl/sdl-common.cpp index 34cbdedfb3..3d3acf573e 100644 --- a/backends/sdl/sdl-common.cpp +++ b/backends/sdl/sdl-common.cpp @@ -847,6 +847,10 @@ bool OSystem_SDL_Common::set_sound_proc(SoundProc *proc, void *param, SoundForma return true; } +void OSystem_SDL_Common::clear_sound_proc() { + SDL_CloseAudio(); +} + uint32 OSystem_SDL_Common::property(int param, Property *value) { switch(param) { diff --git a/backends/sdl/sdl-common.h b/backends/sdl/sdl-common.h index 89d28a8087..c5e6847ffa 100644 --- a/backends/sdl/sdl-common.h +++ b/backends/sdl/sdl-common.h @@ -79,6 +79,8 @@ public: // Set function that generates samples bool set_sound_proc(SoundProc *proc, void *param, SoundFormat format); + + void clear_sound_proc(); // Poll CD status // Returns true if cd audio is playing diff --git a/common/system.h b/common/system.h index d8c06d1ef0..68408a6a13 100644 --- a/common/system.h +++ b/common/system.h @@ -258,6 +258,13 @@ public: * @param format the sample type format. */ virtual bool set_sound_proc(SoundProc *proc, void *param, SoundFormat format) = 0; + + /** + * Remove any audio callback previously set via set_sound_proc, thus effectively + * stopping all audio output immediately. + * @see set_sound_proc + */ + virtual void clear_sound_proc() = 0; //@} |