Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-09-02 21:12:03 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-09-02 21:15:08 +0300
commit1f16b3280f32d1db1302f0fbf3275a27d7c0ebb2 (patch)
tree122ffacc0df47845aa7e9c8ba6ee6dcf5f280972 /source/blender/windowmanager
parent390bc05b328d6fe55241f7ca8d2b7e7a28d198e8 (diff)
Fix T45979: animplayer crashes w/ DND and audio
Issues re-initializing audaspace
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_playanim.c53
1 files changed, 32 insertions, 21 deletions
diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c
index e63b4661870..0d00fb7753d 100644
--- a/source/blender/windowmanager/intern/wm_playanim.c
+++ b/source/blender/windowmanager/intern/wm_playanim.c
@@ -77,10 +77,10 @@
# include AUD_SOUND_H
# include AUD_SPECIAL_H
-AUD_Sound *source = NULL;
-AUD_Handle *playback_handle = NULL;
-AUD_Handle *scrub_handle = NULL;
-AUD_Device *audio_device = NULL;
+static AUD_Sound *source = NULL;
+static AUD_Handle *playback_handle = NULL;
+static AUD_Handle *scrub_handle = NULL;
+static AUD_Device *audio_device = NULL;
#endif
/* simple limiter to avoid flooding memory */
@@ -1101,20 +1101,6 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
PlayState ps = {0};
-#ifdef WITH_AUDASPACE
- AUD_DeviceSpecs specs;
-
- specs.rate = AUD_RATE_44100;
- specs.format = AUD_FORMAT_S16;
- specs.channels = AUD_CHANNELS_STEREO;
-
- AUD_initOnce();
-
- if (!(audio_device = AUD_init("OpenAL", specs, 1024, "Blender")))
- audio_device = AUD_init("Null", specs, 0, "Blender");
-
-#endif
-
/* ps.doubleb = true;*/ /* UNUSED */
ps.go = true;
ps.direction = true;
@@ -1514,12 +1500,16 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
added_images = 0;
#ifdef WITH_AUDASPACE
- if (playback_handle)
+ if (playback_handle) {
AUD_Handle_stop(playback_handle);
- if (scrub_handle)
+ playback_handle = NULL;
+ }
+ if (scrub_handle) {
AUD_Handle_stop(scrub_handle);
+ scrub_handle = NULL;
+ }
AUD_Sound_free(source);
- AUD_exit(audio_device);
+ source = NULL;
#endif
#if 0 // XXX25
@@ -1559,6 +1549,22 @@ void WM_main_playanim(int argc, const char **argv)
{
bool looping = true;
+#ifdef WITH_AUDASPACE
+ {
+ AUD_DeviceSpecs specs;
+
+ specs.rate = AUD_RATE_44100;
+ specs.format = AUD_FORMAT_S16;
+ specs.channels = AUD_CHANNELS_STEREO;
+
+ AUD_initOnce();
+
+ if (!(audio_device = AUD_init("OpenAL", specs, 1024, "Blender"))) {
+ audio_device = AUD_init("Null", specs, 0, "Blender");
+ }
+ }
+#endif
+
while (looping) {
const char *filepath = wm_main_playanim_intern(argc, argv);
@@ -1571,4 +1577,9 @@ void WM_main_playanim(int argc, const char **argv)
looping = false;
}
}
+
+#ifdef WITH_AUDASPACE
+ AUD_exit(audio_device);
+ AUD_exitOnce();
+#endif
}