mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
XAudio2: Use XAUDIO2_VOICE_NOSAMPLESPLAYED when possible.
For versions of XAudio2 with an IXAudio2SourceVoice::GetState() that offers a flags parameter, we can use XAUDIO2_VOICE_NOSAMPLESPLAYED, since we don't need this information in our current calls. According to MSDN, this makes the the call about 3x faster.
This commit is contained in:
parent
e76fecc4ed
commit
db1dd7560e
@ -241,14 +241,14 @@ XAUDIO2_WaitDone(_THIS)
|
|||||||
SDL_assert(!this->enabled); /* flag that stops playing. */
|
SDL_assert(!this->enabled); /* flag that stops playing. */
|
||||||
IXAudio2SourceVoice_Discontinuity(source);
|
IXAudio2SourceVoice_Discontinuity(source);
|
||||||
#if SDL_XAUDIO2_WIN8
|
#if SDL_XAUDIO2_WIN8
|
||||||
IXAudio2SourceVoice_GetState(source, &state, 0);
|
IXAudio2SourceVoice_GetState(source, &state, XAUDIO2_VOICE_NOSAMPLESPLAYED);
|
||||||
#else
|
#else
|
||||||
IXAudio2SourceVoice_GetState(source, &state);
|
IXAudio2SourceVoice_GetState(source, &state);
|
||||||
#endif
|
#endif
|
||||||
while (state.BuffersQueued > 0) {
|
while (state.BuffersQueued > 0) {
|
||||||
SDL_SemWait(this->hidden->semaphore);
|
SDL_SemWait(this->hidden->semaphore);
|
||||||
#if SDL_XAUDIO2_WIN8
|
#if SDL_XAUDIO2_WIN8
|
||||||
IXAudio2SourceVoice_GetState(source, &state, 0);
|
IXAudio2SourceVoice_GetState(source, &state, XAUDIO2_VOICE_NOSAMPLESPLAYED);
|
||||||
#else
|
#else
|
||||||
IXAudio2SourceVoice_GetState(source, &state);
|
IXAudio2SourceVoice_GetState(source, &state);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user