From 9656456d30adb6a30a0de6637ca4e0f6579ce6af Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 18 Mar 2012 11:34:23 -0700 Subject: [PATCH] Make sure the sound decoders are closed when they're finished with --- apps/openmw/mwsound/ffmpeg_decoder.cpp | 1 + apps/openmw/mwsound/mpgsnd_decoder.cpp | 1 + apps/openmw/mwsound/openal_output.cpp | 2 ++ 3 files changed, 4 insertions(+) diff --git a/apps/openmw/mwsound/ffmpeg_decoder.cpp b/apps/openmw/mwsound/ffmpeg_decoder.cpp index 5c64e4dd1..41e25e5b6 100644 --- a/apps/openmw/mwsound/ffmpeg_decoder.cpp +++ b/apps/openmw/mwsound/ffmpeg_decoder.cpp @@ -36,6 +36,7 @@ FFmpeg_Decoder::FFmpeg_Decoder() FFmpeg_Decoder::~FFmpeg_Decoder() { + Close(); } } diff --git a/apps/openmw/mwsound/mpgsnd_decoder.cpp b/apps/openmw/mwsound/mpgsnd_decoder.cpp index 9b51319dd..dbe1d0a50 100644 --- a/apps/openmw/mwsound/mpgsnd_decoder.cpp +++ b/apps/openmw/mwsound/mpgsnd_decoder.cpp @@ -118,6 +118,7 @@ MpgSnd_Decoder::MpgSnd_Decoder() : sndFile(NULL), mpgFile(NULL) MpgSnd_Decoder::~MpgSnd_Decoder() { + Close(); } } diff --git a/apps/openmw/mwsound/openal_output.cpp b/apps/openmw/mwsound/openal_output.cpp index ad21aefbe..f28b09c07 100644 --- a/apps/openmw/mwsound/openal_output.cpp +++ b/apps/openmw/mwsound/openal_output.cpp @@ -332,6 +332,7 @@ Sound* OpenAL_Output::playSound(const std::string &fname, float volume, float pi try { buf = LoadBuffer(decoder); + decoder->Close(); alGenSources(1, &src); throwALerror(); } @@ -380,6 +381,7 @@ Sound* OpenAL_Output::playSound3D(const std::string &fname, const float *pos, fl try { buf = LoadBuffer(decoder); + decoder->Close(); alGenSources(1, &src); throwALerror(); }