Skip to content

Commit 80db564

Browse files
committed
reduce audio underruns
comment out SDL_CondWait in sound_callback (by eggs)
1 parent e07ddeb commit 80db564

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

sound.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -610,13 +610,15 @@ void sound_callback(void *userdata, Uint8 *stream, int length)
610610
s16 *source;
611611
s32 current_sample;
612612

613+
if (((gbc_sound_buffer_index - sound_buffer_base) % BUFFER_SIZE) < length && !sound_exit_flag) return;
614+
613615
SDL_LockMutex(sound_mutex);
614616

615-
while(((gbc_sound_buffer_index - sound_buffer_base) % BUFFER_SIZE) <
616-
length && !sound_exit_flag)
617-
{
618-
SDL_CondWait(sound_cv, sound_mutex);
619-
}
617+
// while(((gbc_sound_buffer_index - sound_buffer_base) % BUFFER_SIZE) <
618+
// length && !sound_exit_flag)
619+
// {
620+
// SDL_CondWait(sound_cv, sound_mutex);
621+
// }
620622

621623
if(global_enable_audio)
622624
{

0 commit comments

Comments
 (0)