Skip to content
Snippets Groups Projects
Commit c4ac6f81 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

When trying to open pulse, play a millisecond of silence

This allows the playback thread to open the device and errors to
be checked.  Otherwise, the first sound won't play.
parent 6a4fbf28
No related branches found
No related tags found
No related merge requests found
......@@ -416,7 +416,17 @@ DLLCALL xptone_open_locked(void)
if(pu_api != NULL) {
handle_type=SOUND_DEVICE_PULSEAUDIO;
handle_rc++;
return(TRUE);
pthread_mutex_unlock(&handle_mutex);
xptone(0, 1, WAVE_SHAPE_SQUARE, FALSE);
pthread_mutex_lock(&handle_mutex);
if (pulseaudio_device_open_failed) {
fprintf(stderr, "Pulse broke\n");
handle_type = SOUND_DEVICE_CLOSED;
}
else {
fprintf(stderr, "Using pulse\n");
return(TRUE);
}
}
}
#endif
......@@ -632,6 +642,7 @@ DLLCALL xptone_open_locked(void)
return(TRUE);
}
#endif
return(FALSE);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment