From 1c825fbd14beceb96077b896f6d3090bc85c655d Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Thu, 5 Apr 2012 12:56:58 +0200 Subject: [PATCH] fix segfaults with FLAC decoder in intro --- src/intro.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/intro.c b/src/intro.c index 36c8068..3c60a3c 100644 --- a/src/intro.c +++ b/src/intro.c @@ -176,6 +176,7 @@ int Intro_Keydown(struct Game *game, ALLEGRO_EVENT *ev) { } if (!game->intro.in_animation) { if (game->intro.audiostream) { + al_set_audio_stream_playing(game->intro.audiostream, false); al_destroy_audio_stream(game->intro.audiostream); game->intro.audiostream=NULL; } @@ -223,7 +224,10 @@ void Intro_Preload(struct Game *game) { } void Intro_Unload(struct Game *game) { - if (game->intro.audiostream) al_destroy_audio_stream(game->intro.audiostream); + if (game->intro.audiostream) { + al_set_audio_stream_playing(game->intro.audiostream, false); + al_destroy_audio_stream(game->intro.audiostream); + } ALLEGRO_EVENT ev; int fadeloop; for(fadeloop=255; fadeloop>=0; fadeloop-=tps(game, 600)){