Skip to content
Snippets Groups Projects
Commit b3b79eec authored by deuce's avatar deuce
Browse files

Remove excess ALSA paranoia

parent 8c8c168a
No related branches found
No related tags found
No related merge requests found
...@@ -625,16 +625,14 @@ void xp_play_sample_thread(void *data) ...@@ -625,16 +625,14 @@ void xp_play_sample_thread(void *data)
#ifdef USE_ALSA_SOUND #ifdef USE_ALSA_SOUND
if(handle_type==SOUND_DEVICE_ALSA) { if(handle_type==SOUND_DEVICE_ALSA) {
if(playback_handle != NULL) { if(alsa_api->snd_pcm_writei(playback_handle, sample_buffer, sample_size)!=sample_size) {
if(alsa_api->snd_pcm_writei(playback_handle, sample_buffer, sample_size)!=sample_size) { /* Go back and try OSS */
/* Go back and try OSS */ alsa_device_open_failed=TRUE;
alsa_device_open_failed=TRUE; xptone_close();
xptone_close(); xptone_open();
xptone_open(); }
} else {
else { alsa_api->snd_pcm_drain(playback_handle);
alsa_api->snd_pcm_drain(playback_handle);
}
} }
} }
#endif #endif
...@@ -760,19 +758,17 @@ BOOL DLLCALL xp_play_sample(const unsigned char *sample, size_t sample_size, BOO ...@@ -760,19 +758,17 @@ BOOL DLLCALL xp_play_sample(const unsigned char *sample, size_t sample_size, BOO
#ifdef USE_ALSA_SOUND #ifdef USE_ALSA_SOUND
if(handle_type==SOUND_DEVICE_ALSA) { if(handle_type==SOUND_DEVICE_ALSA) {
if(playback_handle != NULL) { if(alsa_api->snd_pcm_writei(playback_handle, sample, sample_size)!=sample_size) {
if(alsa_api->snd_pcm_writei(playback_handle, sample, sample_size)!=sample_size) { /* Go back and try OSS */
/* Go back and try OSS */ alsa_device_open_failed=TRUE;
alsa_device_open_failed=TRUE; xptone_close();
xptone_open();
}
else {
alsa_api->snd_pcm_drain(playback_handle);
if(must_close)
xptone_close(); xptone_close();
xptone_open(); return(TRUE);
}
else {
alsa_api->snd_pcm_drain(playback_handle);
if(must_close)
xptone_close();
return(TRUE);
}
} }
} }
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment