From 6c33baf2f90b72a872b47c6bb6601123f38c910e Mon Sep 17 00:00:00 2001 From: retsim01 Date: Sun, 3 Oct 2021 23:09:22 +0200 Subject: [PATCH] movieplayer: introduce g_settings.movieplayer_select_ac3_atype0 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/13589d8689884830de3aa51be9ba4d44e2ff9232 Author: retsim01 Date: 2021-10-03 (Sun, 03 Oct 2021) Origin message was: ------------------ - movieplayer: introduce g_settings.movieplayer_select_ac3_atype0 --- src/gui/movieplayer.cpp | 11 +++++++++++ src/gui/movieplayer.h | 5 +++++ src/neutrino.cpp | 6 ++++++ src/system/settings.h | 3 +++ 4 files changed, 25 insertions(+) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 993eae339..c21036fe3 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1485,6 +1485,12 @@ bool CMoviePlayerGui::PlayFileStart(void) if (is_audio_playing) frameBuffer->showFrame("mp3.jpg"); + +#if HAVE_CST_HARDWARE + if ((g_settings.movieplayer_select_ac3_atype0 == true) && (currentac3 == AC3_ATYPE1)) + currentac3 = AC3_ATYPE0; +#endif + #if HAVE_ARM_HARDWARE bool res = playback->Start((char *) file_name.c_str(), vpid, vtype, currentapid, currentac3, duration,"",second_file_name); #else @@ -2575,12 +2581,17 @@ void CMoviePlayerGui::selectAudioPid() #if HAVE_CST_HARDWARE if (select == numpida) { currentac3 == 1 ? currentac3 = 0 : currentac3 = 1; + currentac3 == 1 ? g_settings.movieplayer_select_ac3_atype0 = false : g_settings.movieplayer_select_ac3_atype0 = true; playback->SetAPid(currentapid, currentac3); printf("[movieplayer] currentac3 changed to %d\n", currentac3); } else if ((select >= 0) && (currentapid != apids[select])) { currentapid = apids[select]; currentac3 = ac3flags[select]; + + if ((g_settings.movieplayer_select_ac3_atype0 == true) && (currentac3 == AC3_ATYPE1)) + currentac3 = AC3_ATYPE0; + playback->SetAPid(currentapid, currentac3); getCurrentAudioName(is_file_player, currentaudioname); printf("[movieplayer] apid changed to %d type %d\n", currentapid, currentac3); diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index d791a5a24..01b768259 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -62,6 +62,11 @@ extern "C" { #define MAX_PLAYBACK_PIDS 40 #endif +#if HAVE_CST_HARDWARE +#define AC3_ATYPE0 0 +#define AC3_ATYPE1 1 +#endif + class CFrameBuffer; class CMoviePlayerGui : public CMenuTarget { diff --git a/src/neutrino.cpp b/src/neutrino.cpp index edf9b1e99..500c863f3 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1187,6 +1187,9 @@ int CNeutrinoApp::loadSetup(const char *fname) g_settings.movieplayer_bisection_jump = configfile.getInt32("movieplayer_bisection_jump", 5); g_settings.movieplayer_display_playtime = configfile.getInt32("movieplayer_display_playtime", g_info.hw_caps->display_type == HW_DISPLAY_LED_NUM); g_settings.movieplayer_repeat_on = configfile.getInt32("movieplayer_repeat_on", CMoviePlayerGui::REPEAT_OFF); +#if HAVE_CST_HARDWARE + g_settings.movieplayer_select_ac3_atype0 = configfile.getBool("movieplayer_select_ac3_atype0", false); +#endif g_settings.movieplayer_timeosd_while_searching = configfile.getInt32("movieplayer_timeosd_while_searching", 1); // filebrowser @@ -2189,6 +2192,9 @@ void CNeutrinoApp::saveSetup(const char *fname) configfile.setInt32("movieplayer_bisection_jump", g_settings.movieplayer_bisection_jump); configfile.setInt32("movieplayer_display_playtime", g_settings.movieplayer_display_playtime); configfile.setInt32("movieplayer_repeat_on", g_settings.movieplayer_repeat_on); +#if HAVE_CST_HARDWARE + configfile.setBool("movieplayer_select_ac3_atype0", g_settings.movieplayer_select_ac3_atype0); +#endif configfile.setInt32("movieplayer_timeosd_while_searching", g_settings.movieplayer_timeosd_while_searching); // filebrowser diff --git a/src/system/settings.h b/src/system/settings.h index 54ef47f43..f61d387eb 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -976,6 +976,9 @@ struct SNeutrinoSettings int movieplayer_bisection_jump; int movieplayer_display_playtime; int movieplayer_repeat_on; +#if HAVE_CST_HARDWARE + bool movieplayer_select_ac3_atype0; +#endif int movieplayer_timeosd_while_searching; // filebrowser