From 1983aa1652f5eba155c2889ef32c9b71de39d352 Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Sun, 27 Aug 2017 18:11:48 -0400 Subject: [PATCH] try making sure that the bincue sources use the correct, SDL2 audio device ID. Untested! --- BasiliskII/src/SDL/audio_sdl.cpp | 4 ++-- BasiliskII/src/Unix/bincue_unix.cpp | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/BasiliskII/src/SDL/audio_sdl.cpp b/BasiliskII/src/SDL/audio_sdl.cpp index 7b7cb107..767e0f38 100644 --- a/BasiliskII/src/SDL/audio_sdl.cpp +++ b/BasiliskII/src/SDL/audio_sdl.cpp @@ -45,8 +45,8 @@ static int audio_sample_size_index = 0; static int audio_channel_count_index = 0; // Global variables -static SDL_AudioDeviceID audio_device = 0; -static SDL_AudioSpec audio_spec_obtained; +SDL_AudioDeviceID audio_device = 0; +SDL_AudioSpec audio_spec_obtained; static SDL_sem *audio_irq_done_sem = NULL; // Signal from interrupt to streaming thread: data block read static uint8 silence_byte; // Byte value to use to fill sound buffers with silence static uint8 *audio_mix_buf = NULL; diff --git a/BasiliskII/src/Unix/bincue_unix.cpp b/BasiliskII/src/Unix/bincue_unix.cpp index 612cf790..156c3c8f 100644 --- a/BasiliskII/src/Unix/bincue_unix.cpp +++ b/BasiliskII/src/Unix/bincue_unix.cpp @@ -49,6 +49,8 @@ static int bincue_core_audio_callback(void); #ifdef USE_SDL_AUDIO #include #include +extern SDL_AudioDeviceID audio_device; +extern SDL_AudioSpec audio_spec_obtained; #endif #include "bincue_unix.h" @@ -664,7 +666,7 @@ bool CDPlay_bincue(void *fh, uint8 start_m, uint8 start_s, uint8 start_f, MSF msf; #ifdef USE_SDL_AUDIO - SDL_LockAudio(); + SDL_LockAudioDevice(audio_device); #endif player.audiostatus = CDROM_AUDIO_NO_STATUS; @@ -709,7 +711,7 @@ bool CDPlay_bincue(void *fh, uint8 start_m, uint8 start_s, uint8 start_f, D(bug("CDPlay_bincue: play beyond last track !\n")); #ifdef USE_SDL_AUDIO - SDL_UnlockAudio(); + SDL_UnlockAudioDevice(audio_device); #endif if (audio_enabled) { @@ -804,7 +806,7 @@ void MixAudio_bincue(uint8 *stream, int stream_len) if (audio_enabled && (player.audiostatus == CDROM_AUDIO_PLAY)) { uint8 *buf = fill_buffer(stream_len); if (buf) - SDL_MixAudio(stream, buf, stream_len, SDL_MIX_MAXVOLUME); + SDL_MixAudioFormat(stream, buf, audio_spec_obtained.format, stream_len, SDL_MIX_MAXVOLUME); } }