From f6e13aded78ee12067c9187d3e06304acc4ac23d Mon Sep 17 00:00:00 2001 From: TangoCash Date: Fri, 5 Nov 2021 20:09:04 +0100 Subject: [PATCH] some cec volume fixes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4759ebd15050a8ac62a9bfa7e65744c5746772fe Author: TangoCash Date: 2021-11-05 (Fri, 05 Nov 2021) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/cec_setup.cpp | 1 + src/gui/lua/lua_misc.cpp | 1 + src/neutrino.cpp | 13 ++++++------- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/gui/cec_setup.cpp b/src/gui/cec_setup.cpp index 6f02dae18..3775c206d 100644 --- a/src/gui/cec_setup.cpp +++ b/src/gui/cec_setup.cpp @@ -162,6 +162,7 @@ bool CCECSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*/ #if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE if (g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF) { + g_settings.current_volume = 100; videoDecoder->SetAudioDestination(g_settings.hdmi_cec_volume); } #endif diff --git a/src/gui/lua/lua_misc.cpp b/src/gui/lua/lua_misc.cpp index 380f5ffc6..c4e033888 100644 --- a/src/gui/lua/lua_misc.cpp +++ b/src/gui/lua/lua_misc.cpp @@ -199,6 +199,7 @@ int CLuaInstMisc::enableMuteIcon(lua_State *L) int CLuaInstMisc::setVolume(lua_State *L) { + if (g_settings.hdmi_cec_volume) return 0; CLuaMisc *D = MiscCheckData(L, 1); if (!D) return 0; lua_Integer vol = luaL_checkint(L, 2); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index e3819b511..0ceea0aa2 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -479,11 +479,11 @@ int CNeutrinoApp::loadSetup(const char *fname) #endif // volume - g_settings.current_volume = configfile.getInt32("current_volume", 75); + g_settings.current_volume = g_settings.hdmi_cec_volume ? 100 : configfile.getInt32("current_volume", 75); g_settings.current_volume_step = configfile.getInt32("current_volume_step", 5); - g_settings.start_volume = configfile.getInt32("start_volume", -1); + g_settings.start_volume = g_settings.hdmi_cec_volume ? 100 : configfile.getInt32("start_volume", -1); if (g_settings.start_volume >= 0) - g_settings.current_volume = g_settings.hdmi_cec_volume ? 75 : g_settings.start_volume; + g_settings.current_volume = g_settings.hdmi_cec_volume ? 100 : g_settings.start_volume; g_settings.audio_volume_percent_ac3 = configfile.getInt32("audio_volume_percent_ac3", 100); g_settings.audio_volume_percent_pcm = configfile.getInt32("audio_volume_percent_pcm", 100); @@ -1705,10 +1705,9 @@ void CNeutrinoApp::saveSetup(const char *fname) #endif // volume - if (!g_settings.hdmi_cec_volume) - configfile.setInt32("current_volume", g_settings.current_volume); + configfile.setInt32( "current_volume", g_settings.hdmi_cec_volume ? 100 : g_settings.current_volume ); configfile.setInt32("current_volume_step", g_settings.current_volume_step); - configfile.setInt32("start_volume", g_settings.start_volume); + configfile.setInt32( "start_volume", g_settings.hdmi_cec_volume ? 100 : g_settings.start_volume ); configfile.setInt32("audio_volume_percent_ac3", g_settings.audio_volume_percent_ac3); configfile.setInt32("audio_volume_percent_pcm", g_settings.audio_volume_percent_pcm); @@ -3104,7 +3103,7 @@ TIMER_START(); ZapStart_arg.ci_delay = g_settings.ci_delay; memcpy(ZapStart_arg.ci_rpr, g_settings.ci_rpr, sizeof(g_settings.ci_rpr)); #endif - ZapStart_arg.volume = g_settings.hdmi_cec_volume ? 75 : g_settings.current_volume; + ZapStart_arg.volume = g_settings.current_volume; ZapStart_arg.webtv_xml = &g_settings.webtv_xml; ZapStart_arg.webradio_xml = &g_settings.webradio_xml;