mirror of
https://github.com/xemu-project/xemu.git
synced 2026-07-11 01:24:41 +02:00
xblc: Move devid closer to use
This commit is contained in:
committed by
mborgerson
parent
7ee851c1a5
commit
e92faef161
+5
-4
@@ -165,18 +165,19 @@ static void usb_xblc_handle_reset(USBDevice *dev)
|
||||
static void xblc_audio_channel_init(USBXBLCState *s, bool capture)
|
||||
{
|
||||
SDL_AudioStream **channel = capture ? &s->in : &s->out;
|
||||
SDL_AudioDeviceID device_id = capture ? SDL_AUDIO_DEVICE_DEFAULT_RECORDING :
|
||||
SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK;
|
||||
|
||||
if (*channel != NULL) {
|
||||
SDL_DestroyAudioStream(*channel);
|
||||
*channel = NULL;
|
||||
}
|
||||
|
||||
SDL_AudioSpec spec = { .channels = 1, .freq = s->sample_rate,
|
||||
SDL_AudioDeviceID devid = capture ? SDL_AUDIO_DEVICE_DEFAULT_RECORDING :
|
||||
SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK;
|
||||
SDL_AudioSpec spec = { .channels = 1,
|
||||
.freq = s->sample_rate,
|
||||
.format = SDL_AUDIO_S16LE };
|
||||
|
||||
*channel = SDL_OpenAudioDeviceStream(device_id, &spec, NULL, (void *)s);
|
||||
*channel = SDL_OpenAudioDeviceStream(devid, &spec, NULL, (void *)s);
|
||||
if (*channel == NULL) {
|
||||
DPRINTF("[XBLC] Failed to open audio device stream: %s\n",
|
||||
SDL_GetError());
|
||||
|
||||
Reference in New Issue
Block a user