mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 15:40:44 +00:00
(Audio drivers) Get rid of global state dependencies
This commit is contained in:
parent
6e327a3b8d
commit
dcf4037582
@ -185,6 +185,8 @@ static bool ctr_audio_alive(void *data)
|
||||
static bool ctr_audio_start(void *data)
|
||||
{
|
||||
ctr_audio_t* ctr = (ctr_audio_t*)data;
|
||||
/* TODO/FIXME - we should not depend upon global state
|
||||
* in audio/video/input drivers. */
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
/* prevents restarting audio when the menu
|
||||
|
@ -81,7 +81,6 @@ static void *ps3_audio_init(const char *device,
|
||||
{
|
||||
CellAudioPortParam params;
|
||||
ps3_audio_t *data = NULL;
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
(void)latency;
|
||||
(void)device;
|
||||
@ -95,10 +94,12 @@ static void *ps3_audio_init(const char *device,
|
||||
|
||||
params.numChannels = AUDIO_CHANNELS;
|
||||
params.numBlocks = AUDIO_BLOCKS;
|
||||
#if 0
|
||||
#ifdef HAVE_HEADSET
|
||||
if(global->console.sound.mode == SOUND_MODE_HEADSET)
|
||||
params.param_attrib = CELL_AUDIO_PORTATTR_OUT_SECONDARY;
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
params.param_attrib = 0;
|
||||
|
||||
|
@ -77,6 +77,7 @@ struct xaudio2 : public IXAudio2VoiceCallback
|
||||
unsigned write_buffer;
|
||||
};
|
||||
|
||||
#if 0
|
||||
static void xaudio2_enumerate_devices(xaudio2_t *xa)
|
||||
{
|
||||
uint32_t dev_count = 0;
|
||||
@ -97,6 +98,7 @@ static void xaudio2_enumerate_devices(xaudio2_t *xa)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
static void xaudio2_set_wavefmt(WAVEFORMATEX *wfx,
|
||||
unsigned channels, unsigned samplerate)
|
||||
@ -226,17 +228,14 @@ static size_t xaudio2_write(xaudio2_t *handle, const void *buf, size_t bytes_)
|
||||
static void *xa_init(const char *device, unsigned rate, unsigned latency)
|
||||
{
|
||||
size_t bufsize;
|
||||
xa_t *xa = NULL;
|
||||
unsigned device_index = 0;
|
||||
global_t *global = global_get_ptr();
|
||||
xa_t *xa = (xa_t*)calloc(1, sizeof(*xa));
|
||||
if (!xa)
|
||||
return NULL;
|
||||
|
||||
if (latency < 8)
|
||||
latency = 8; /* Do not allow shenanigans. */
|
||||
|
||||
xa = (xa_t*)calloc(1, sizeof(*xa));
|
||||
if (!xa)
|
||||
return NULL;
|
||||
|
||||
bufsize = latency * rate / 1000;
|
||||
|
||||
RARCH_LOG("XAudio2: Requesting %u ms latency, using %d ms latency.\n",
|
||||
@ -255,9 +254,6 @@ static void *xa_init(const char *device, unsigned rate, unsigned latency)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (global->verbosity)
|
||||
xaudio2_enumerate_devices(xa->xa);
|
||||
|
||||
return xa;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user