From ae38db49158453be2c8f6c7f8edccf669247ccce Mon Sep 17 00:00:00 2001 From: Quantum Date: Wed, 1 Jun 2022 22:50:42 -0400 Subject: [PATCH] [client] main: move micDefaultState into g_state --- client/src/audio.c | 4 ++-- client/src/main.c | 2 ++ client/src/main.h | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/audio.c b/client/src/audio.c index 1bf1cb3c..9daa2bf3 100644 --- a/client/src/audio.c +++ b/client/src/audio.c @@ -814,9 +814,9 @@ void audio_recordStart(int channels, int sampleRate, PSAudioFormat format) if (audio.record.started) realRecordStart(channels, sampleRate, format); - else if (g_params.micDefaultState == MIC_DEFAULT_DENY) + else if (g_state.micDefaultState == MIC_DEFAULT_DENY) DEBUG_INFO("Microphone access denied by default"); - else if (g_params.micDefaultState == MIC_DEFAULT_ALLOW) + else if (g_state.micDefaultState == MIC_DEFAULT_ALLOW) { DEBUG_INFO("Microphone access granted by default"); realRecordStart(channels, sampleRate, format); diff --git a/client/src/main.c b/client/src/main.c index 7a9e9767..b8b30160 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -1234,6 +1234,8 @@ static int lg_run(void) }; purespice_init(&psInit); + g_state.micDefaultState = g_params.micDefaultState; + if (g_params.useSpiceInput || g_params.useSpiceClipboard || g_params.useSpiceAudio) diff --git a/client/src/main.h b/client/src/main.h index 0b8b1077..74279936 100644 --- a/client/src/main.h +++ b/client/src/main.h @@ -147,6 +147,8 @@ struct AppState bool resizeDone; bool autoIdleInhibitState; + + enum MicDefaultState micDefaultState; }; struct AppParams