mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
Fixed race condition where XMP voices could be played by the audio driver thread before they were fully initialized or fully freed
git-svn-id: https://svn.eduke32.com/eduke32@6564 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
bcb41aac3e
commit
efaf328e4d
1 changed files with 5 additions and 2 deletions
|
@ -157,6 +157,9 @@ int32_t MV_PlayXMP(char *ptr, uint32_t ptrlength, int32_t loopstart, int32_t loo
|
||||||
|
|
||||||
xmpd->owner = voice;
|
xmpd->owner = voice;
|
||||||
|
|
||||||
|
voice->length = 0;
|
||||||
|
voice->sound = 0;
|
||||||
|
|
||||||
voice->wavetype = FMT_XMP;
|
voice->wavetype = FMT_XMP;
|
||||||
voice->rawdataptr = (void*)xmpd;
|
voice->rawdataptr = (void*)xmpd;
|
||||||
voice->GetSound = MV_GetNextXMPBlock;
|
voice->GetSound = MV_GetNextXMPBlock;
|
||||||
|
@ -199,12 +202,12 @@ void MV_ReleaseXMPVoice(VoiceNode * voice)
|
||||||
if (voice->wavetype != FMT_XMP)
|
if (voice->wavetype != FMT_XMP)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
voice->rawdataptr = 0;
|
||||||
|
|
||||||
xmp_end_player(xmpd->context);
|
xmp_end_player(xmpd->context);
|
||||||
xmp_release_module(xmpd->context);
|
xmp_release_module(xmpd->context);
|
||||||
xmp_free_context(xmpd->context);
|
xmp_free_context(xmpd->context);
|
||||||
free(xmpd);
|
free(xmpd);
|
||||||
|
|
||||||
voice->rawdataptr = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue