mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 16:54:03 +02:00
Try fixing a bug where a sound is never unmarked as mixing.
This should fix a deadlock when uninitializing a sound after it's reached the end.
This commit is contained in:
@@ -8338,11 +8338,7 @@ static void ma_engine_mix_sound(ma_engine* pEngine, ma_sound_group* pGroup, ma_s
|
|||||||
ma_uint64 framesProcessed;
|
ma_uint64 framesProcessed;
|
||||||
|
|
||||||
/* If we're marked at the end we need to stop the sound and do nothing. */
|
/* If we're marked at the end we need to stop the sound and do nothing. */
|
||||||
if (pSound->atEnd) {
|
if (!pSound->atEnd) {
|
||||||
ma_sound_stop_internal(pSound);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If we're seeking, do so now before reading. */
|
/* If we're seeking, do so now before reading. */
|
||||||
if (pSound->seekTarget != MA_SEEK_TARGET_NONE) {
|
if (pSound->seekTarget != MA_SEEK_TARGET_NONE) {
|
||||||
pSound->seekTarget = MA_SEEK_TARGET_NONE;
|
pSound->seekTarget = MA_SEEK_TARGET_NONE;
|
||||||
@@ -8405,6 +8401,10 @@ static void ma_engine_mix_sound(ma_engine* pEngine, ma_sound_group* pGroup, ma_s
|
|||||||
ma_sound_stop_internal(pSound);
|
ma_sound_stop_internal(pSound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
/* The sound is at the end. Make sure it's marked as stopped. */
|
||||||
|
ma_sound_stop_internal(pSound);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
c89atomic_exchange_32(&pSound->isMixing, MA_FALSE);
|
c89atomic_exchange_32(&pSound->isMixing, MA_FALSE);
|
||||||
|
|||||||
Reference in New Issue
Block a user