From 9e45f6d05f95c9c5566d26ed147214b345456b1f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 12 Sep 2017 01:02:08 -0700 Subject: [PATCH] Make a note that stopTrack needs to be called for a stopping track --- apps/openmw/mwbase/soundmanager.hpp | 3 ++- apps/openmw/mwsound/soundmanagerimp.cpp | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwbase/soundmanager.hpp b/apps/openmw/mwbase/soundmanager.hpp index 9986564cd..4439fe8f3 100644 --- a/apps/openmw/mwbase/soundmanager.hpp +++ b/apps/openmw/mwbase/soundmanager.hpp @@ -107,7 +107,8 @@ namespace MWBase /// If the actor is not saying anything, returns 0. virtual SoundStream *playTrack(const MWSound::DecoderPtr& decoder, PlayType type) = 0; - ///< Play a 2D audio track, using a custom decoder + ///< Play a 2D audio track, using a custom decoder. The caller is expected to call + /// stopTrack with the returned handle when done. virtual void stopTrack(SoundStream *stream) = 0; ///< Stop the given audio track from playing diff --git a/apps/openmw/mwsound/soundmanagerimp.cpp b/apps/openmw/mwsound/soundmanagerimp.cpp index f8b753a18..0dd3ef754 100644 --- a/apps/openmw/mwsound/soundmanagerimp.cpp +++ b/apps/openmw/mwsound/soundmanagerimp.cpp @@ -1083,7 +1083,6 @@ namespace MWSound if(!mOutput->isStreamPlaying(sound)) { mOutput->finishStream(sound); - mUnusedStreams.push_back(sound); trkiter = mActiveTracks.erase(trkiter); } else