aboutsummaryrefslogtreecommitdiffstats
path: root/al
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-02-23 21:40:54 -0800
committerChris Robinson <[email protected]>2020-02-23 21:40:54 -0800
commit90d45984dcaeb0232862cf6fb81af186cd328a63 (patch)
tree86ca49ff693c18451cb2a73603a7735933faa248 /al
parent8554e6cde2f3a7014de2f7ce42553b4828b9105d (diff)
Simplify replaying a source
Diffstat (limited to 'al')
-rw-r--r--al/source.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/al/source.cpp b/al/source.cpp
index 76f6c54b..dd79a1b6 100644
--- a/al/source.cpp
+++ b/al/source.cpp
@@ -2744,6 +2744,7 @@ START_API_FUNC
case AL_PAUSED:
assert(voice != nullptr);
/* A source that's paused simply resumes. */
+ cur->mOldVoice = nullptr;
cur->mVoice = voice;
cur->mSourceID = source->id;
cur->mState = AL_PLAYING;
@@ -2757,17 +2758,13 @@ START_API_FUNC
* fades back to the beginning.
*/
voice->mPendingStop.store(true, std::memory_order_relaxed);
- cur->mVoice = voice;
- cur->mSourceID = source->id;
- cur->mState = AL_STOPPED;
+ cur->mOldVoice = voice;
voice = nullptr;
-
- cur->mNext.store(GetVoiceChanger(context.get()), std::memory_order_relaxed);
- cur = cur->mNext.load(std::memory_order_relaxed);
break;
default:
assert(voice == nullptr);
+ cur->mOldVoice = nullptr;
break;
}