Skip to content

Commit

Permalink
some cec volume fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TangoCash authored and vanhofen committed Nov 5, 2021
1 parent 6645f2d commit 4759ebd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/gui/cec_setup.cpp
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/gui/lua/lua_misc.cpp
Expand Up @@ -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);
Expand Down
13 changes: 6 additions & 7 deletions src/neutrino.cpp
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 4759ebd

Please sign in to comment.