mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 16:33:50 +00:00
AUDIO: Use DisposablePtr-move constructor for looping in mixer
It's much cleaner than disowning the pointer from DisposablePtr
This commit is contained in:
parent
d6d85c8093
commit
27532df2c7
@ -635,11 +635,8 @@ Timestamp Channel::getElapsedTime() {
|
||||
void Channel::loop() {
|
||||
assert(_stream);
|
||||
|
||||
Audio::RewindableAudioStream *rewindableStream = dynamic_cast<RewindableAudioStream *>(_stream.get());
|
||||
if (rewindableStream) {
|
||||
DisposeAfterUse::Flag dispose = _stream.getDispose();
|
||||
_stream.disownPtr();
|
||||
Audio::LoopingAudioStream *loopingStream = new Audio::LoopingAudioStream(rewindableStream, 0, dispose, false);
|
||||
if (_stream.isDynamicallyCastable<RewindableAudioStream>()) {
|
||||
Audio::LoopingAudioStream *loopingStream = new Audio::LoopingAudioStream(Common::move(_stream.moveAndDynamicCast<RewindableAudioStream>()), 0, false);
|
||||
_stream.reset(loopingStream, DisposeAfterUse::YES);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user