fix if statement in SDL sound driver #396

@denisfa found this due to a warning, this should improve the
functionality of the SDL sound driver.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2019-04-01 08:42:52 -07:00
parent 41ee35f22e
commit d9a7df6105
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 2 additions and 1 deletions

View File

@ -60,11 +60,12 @@ void SoundSDL::read(uint16_t* stream, int length) {
if (!initialized || !emulating)
return;
if (!buffer_size())
if (!buffer_size()) {
if (should_wait())
SDL_SemWait(data_available);
else
return;
}
SDL_LockMutex(mutex);