mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-12-24 10:32:32 +00:00
try making sure that the bincue sources use the correct, SDL2 audio device ID. Untested!
This commit is contained in:
parent
d5e68ceebf
commit
1983aa1652
@ -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;
|
||||
|
@ -49,6 +49,8 @@ static int bincue_core_audio_callback(void);
|
||||
#ifdef USE_SDL_AUDIO
|
||||
#include <SDL.h>
|
||||
#include <SDL_audio.h>
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user