From aa9a0ec79b123707152fdd34c80ca78cc4fecff1 Mon Sep 17 00:00:00 2001 From: Shaun Inman Date: Sat, 18 Mar 2023 09:57:04 -0400 Subject: [PATCH] commented out pass at getting hdmi audio working --- src/common/api.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/common/api.c b/src/common/api.c index 0f69f93..0fd6acb 100644 --- a/src/common/api.c +++ b/src/common/api.c @@ -991,7 +991,17 @@ static void SND_selectResampler(void) { // plat_sound_select_resampler } size_t SND_batchSamples(const SND_Frame* frames, size_t frame_count) { // plat_sound_write / plat_sound_write_resample if (snd.frame_count==0) return 0; - + + // static int had_hdmi = -1; + // int has_hdmi = GetHDMI(); + // if (had_hdmi<0) had_hdmi = has_hdmi; + // if (has_hdmi!=had_hdmi) { + // had_hdmi = has_hdmi; + // if (has_hdmi) sleep(2); + // SND_quit(); + // SND_init(snd.sample_rate_in, snd.frame_rate); + // } + SDL_LockAudio(); int consumed = 0; @@ -1019,6 +1029,10 @@ size_t SND_batchSamples(const SND_Frame* frames, size_t frame_count) { // plat_s } void SND_init(double sample_rate, double frame_rate) { // plat_sound_init + LOG_info("SND_init\n"); + + // SDL_putenv(GetHDMI()?"AUDIODEV=plughw:0,1":"default"); + SDL_InitSubSystem(SDL_INIT_AUDIO); snd.frame_rate = frame_rate;