(Switch) Cleanups

This commit is contained in:
twinaphex 2020-07-31 14:47:14 +02:00
parent 0c7ee3d573
commit 1f1571425a
1 changed files with 10 additions and 14 deletions

View File

@ -32,9 +32,8 @@
#define SAMPLE_RATE 48000
#define NUM_CHANNELS 2
#ifndef HAVE_LIBNX
#define SAMPLE_BUFFER_SIZE (((SAMPLE_RATE * NUM_CHANNELS * sizeof(uint16_t)) + 0xfff) & ~0xfff)
#endif
typedef struct
{
@ -55,8 +54,8 @@ typedef struct
static uint32_t switch_audio_data_size(void)
{
static const int framerate = 1000 / 30;
static const int samplecount = (SAMPLE_RATE / framerate);
return (samplecount * NUM_CHANNELS * sizeof(uint16_t));
static const int sample_count = (SAMPLE_RATE / framerate);
return (sample_count * NUM_CHANNELS * sizeof(uint16_t));
}
#else
static uint32_t switch_audio_data_size(void)
@ -67,7 +66,6 @@ static uint32_t switch_audio_data_size(void)
static size_t switch_audio_buffer_size(void *data)
{
(void) data;
#ifdef HAVE_LIBNX
return (switch_audio_data_size() + 0xfff) & ~0xfff;
#else
@ -154,7 +152,6 @@ static bool switch_audio_stop(void *data)
/* TODO/FIXME - fix libnx codepath */
#ifndef HAVE_LIBNX
if (!swa->is_paused)
if (switch_audio_ipc_output_stop(swa) != 0)
return false;
@ -214,7 +211,6 @@ static void switch_audio_free(void *data)
static bool switch_audio_use_float(void *data)
{
(void) data;
return false; /* force INT16 */
}