[mupen64plus] 131/262: Stop audio processing thread before freeing buffers

Sven Eckelmann ecsv-guest at moszumanska.debian.org
Thu Nov 26 05:59:26 UTC 2015


This is an automated email from the git hooks/post-receive script.

ecsv-guest pushed a commit to branch master
in repository mupen64plus.

commit cd4eb1cdd18b52c224954a24097eb74215a0cc3f
Author: Sven Eckelmann <sven.eckelmann at gmx.de>
Date:   Tue Sep 22 00:38:42 2009 +0200

    Stop audio processing thread before freeing buffers
    
    SDL_PauseAudio is called to stop the audio, but that doesn't stop the
    audio processing right away. This means if it still is in SDL_MixAudio
    to change the volume and we start right away to free all buffers, it
    will segfault.
    We can call SDL_CloseAudio before freeing all buffers to be sure that
    my_audio_callback is stopped and doesn't process any data from the
    buffers anymore when we clean everything up in RomClosed.
---
 debian/changelog                        |  2 ++
 debian/patches/jttl_fix_romclosed.patch | 37 +++++++++++++++++++++++++++++++++
 debian/patches/series                   |  1 +
 3 files changed, 40 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 3fc174f..79a5b5b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,8 @@ mupen64plus (1.5+dfsg1-5) UNRELEASED; urgency=low
       (Closes: #547644)
     - Add fix_readpng.patch, Fix crash when loading png due to reordering
       optimizer
+    - Add jttl_fix_romclosed.patch, Stop audio processing thread before freeing
+      buffers to fix segfault during stop of emulation
 
  -- Sven Eckelmann <sven.eckelmann at gmx.de>  Fri, 11 Sep 2009 00:37:19 +0200
 
diff --git a/debian/patches/jttl_fix_romclosed.patch b/debian/patches/jttl_fix_romclosed.patch
new file mode 100644
index 0000000..f01ea66
--- /dev/null
+++ b/debian/patches/jttl_fix_romclosed.patch
@@ -0,0 +1,37 @@
+Description: Stop audio processing thread before freeing buffers
+ SDL_PauseAudio is called to stop the audio, but that doesn't stop the audio
+ processing right away. This means if it still is in SDL_MixAudio to change the
+ volume and we start right away to free all buffers, it will segfault.
+ We can call SDL_CloseAudio before freeing all buffers to be sure that
+ my_audio_callback is stopped and doesn't process any data from the buffers
+ anymore when we clean everything up in RomClosed.
+Bug: http://code.google.com/p/mupen64plus/issues/detail?id=269
+Author: Sven Eckelmann <sven.eckelmann at gmx.de>
+
+---
+diff --git a/jttl_audio/main.c b/jttl_audio/main.c
+index d671cb9fc2f8ebae18e01ef7a86d22cd1e79f857..b8e3a9c248ebb30ed7811a7426fe97e3120626fc 100644
+--- a/jttl_audio/main.c
++++ b/jttl_audio/main.c
+@@ -715,7 +715,10 @@ EXPORT void CALL RomClosed( void )
+     
+     // Pause SDL Audio (Should be done before clean up)
+     SDL_PauseAudio(1);
+-    
++
++    // Actually close the audio device
++    SDL_CloseAudio();
++
+     // Delete the buffer, as we are done producing sound
+     if (buffer != NULL)
+     {
+@@ -733,9 +736,6 @@ EXPORT void CALL RomClosed( void )
+     hardware_spec = NULL;
+     buffer = NULL;
+ 
+-    // Actually close the audio device
+-    SDL_CloseAudio();
+-
+     // Shutdown the respective subsystems
+     if(SDL_WasInit(SDL_INIT_AUDIO) != 0) SDL_QuitSubSystem(SDL_INIT_AUDIO);
+     if(SDL_WasInit(SDL_INIT_TIMER) != 0) SDL_QuitSubSystem(SDL_INIT_TIMER);
diff --git a/debian/patches/series b/debian/patches/series
index 51573fd..c62b0ec 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -24,3 +24,4 @@ default-optimisations.patch
 gtk-open-filter.patch
 noexecstack.patch
 fix_readpng.patch
+jttl_fix_romclosed.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mupen64plus.git



More information about the Pkg-games-commits mailing list