Skip to content

Commit 0da2951

Browse files
authored
Clear Flags::formatMismatch when decoding resumed (#712)
1 parent f201b1f commit 0da2951

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/CSFBAudioEngine/Player/AudioPlayer.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,11 @@ bool PerformSeek() noexcept
10271027
if(decoderState->IsDecodingComplete()) {
10281028
os_log_debug(log_, "Resuming decoding for %{public}@", decoderState->decoder_);
10291029

1030+
// The decoder has not completed rendering so the ring buffer format and the decoder's format still match.
1031+
// Clear the format mismatch flag so rendering can continue; the flag will be set again when
1032+
// decoding completes.
1033+
flags_.fetch_and(~static_cast<unsigned int>(Flags::formatMismatch), std::memory_order_acq_rel);
1034+
10301035
decoderState->flags_.fetch_and(~static_cast<unsigned int>(DecoderState::Flags::decodingComplete), std::memory_order_acq_rel);
10311036
decoderState->flags_.fetch_or(static_cast<unsigned int>(DecoderState::Flags::decodingResumed), std::memory_order_acq_rel);
10321037

0 commit comments

Comments
 (0)