diff options
Diffstat (limited to 'engines/sci/sound')
-rw-r--r-- | engines/sci/sound/audio32.cpp | 10 | ||||
-rw-r--r-- | engines/sci/sound/audio32.h | 5 |
2 files changed, 4 insertions, 11 deletions
diff --git a/engines/sci/sound/audio32.cpp b/engines/sci/sound/audio32.cpp index 0bef60b465..04d1a47ece 100644 --- a/engines/sci/sound/audio32.cpp +++ b/engines/sci/sound/audio32.cpp @@ -557,8 +557,6 @@ void Audio32::freeChannel(const int16 channelIndex) { channel.resource = nullptr; delete channel.stream; channel.stream = nullptr; - delete channel.resourceStream; - channel.resourceStream = nullptr; } delete channel.converter; @@ -797,14 +795,14 @@ uint16 Audio32::play(int16 channelIndex, const ResourceId resourceId, const bool _monitoredChannelIndex = channelIndex; } - Common::SeekableReadStream *dataStream = channel.resourceStream = resource->makeStream(); + Common::SeekableReadStream *dataStream = resource->makeStream(); Audio::RewindableAudioStream *audioStream; if (detectSolAudio(*dataStream)) { - audioStream = makeSOLStream(dataStream, DisposeAfterUse::NO); + audioStream = makeSOLStream(dataStream, DisposeAfterUse::YES); } else if (detectWaveAudio(*dataStream)) { - audioStream = Audio::makeWAVStream(dataStream, DisposeAfterUse::NO); + audioStream = Audio::makeWAVStream(dataStream, DisposeAfterUse::YES); } else { byte flags = Audio::FLAG_LITTLE_ENDIAN; if (_globalBitDepth == 16) { @@ -817,7 +815,7 @@ uint16 Audio32::play(int16 channelIndex, const ResourceId resourceId, const bool flags |= Audio::FLAG_STEREO; } - audioStream = Audio::makeRawStream(dataStream, _globalSampleRate, flags, DisposeAfterUse::NO); + audioStream = Audio::makeRawStream(dataStream, _globalSampleRate, flags, DisposeAfterUse::YES); } channel.stream = new MutableLoopAudioStream(audioStream, loop); diff --git a/engines/sci/sound/audio32.h b/engines/sci/sound/audio32.h index 59f96a85de..a994113e32 100644 --- a/engines/sci/sound/audio32.h +++ b/engines/sci/sound/audio32.h @@ -52,11 +52,6 @@ struct AudioChannel { Resource *resource; /** - * Data stream containing the raw audio for the channel. - */ - Common::SeekableReadStream *resourceStream; - - /** * The audio stream loaded into this channel. Can cast * to `SeekableAudioStream` for normal channels and * `RobotAudioStream` for robot channels. |