diff options
Diffstat (limited to 'audio/mixer.cpp')
-rw-r--r-- | audio/mixer.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/audio/mixer.cpp b/audio/mixer.cpp index 128224ae85..965766170d 100644 --- a/audio/mixer.cpp +++ b/audio/mixer.cpp @@ -163,9 +163,8 @@ private: uint32 _pauseStartTime; uint32 _pauseTime; - DisposeAfterUse::Flag _autofreeStream; RateConverter *_converter; - AudioStream *_stream; + Common::DisposablePtr<AudioStream> _stream; }; #pragma mark - @@ -492,8 +491,8 @@ Channel::Channel(Mixer *mixer, Mixer::SoundType type, AudioStream *stream, DisposeAfterUse::Flag autofreeStream, bool reverseStereo, int id, bool permanent) : _type(type), _mixer(mixer), _id(id), _permanent(permanent), _volume(Mixer::kMaxChannelVolume), _balance(0), _pauseLevel(0), _samplesConsumed(0), _samplesDecoded(0), _mixerTimeStamp(0), - _pauseStartTime(0), _pauseTime(0), _autofreeStream(autofreeStream), _converter(0), - _stream(stream) { + _pauseStartTime(0), _pauseTime(0), _converter(0), + _stream(stream, autofreeStream) { assert(mixer); assert(stream); @@ -503,8 +502,6 @@ Channel::Channel(Mixer *mixer, Mixer::SoundType type, AudioStream *stream, Channel::~Channel() { delete _converter; - if (_autofreeStream == DisposeAfterUse::YES) - delete _stream; } void Channel::setVolume(const byte volume) { |