From ccfa7fa2dd3f2def0f392d7fa6fd1470417c1797 Mon Sep 17 00:00:00 2001 From: BPanther Date: Wed, 26 Jul 2023 13:55:30 +0200 Subject: [PATCH] new option added for eof retries on lost server connections --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/mediaplayer_setup.cpp | 4 ++++ src/gui/movieplayer.cpp | 8 ++++---- src/neutrino.cpp | 2 ++ src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/settings.h | 17 +++++++++-------- 8 files changed, 23 insertions(+), 12 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 80bfd6c8b..3a8e14110 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1875,6 +1875,7 @@ movieplayer.bookmarkname_hint1 Neues Lesezeichen movieplayer.bookmarkname_hint2 Geben Sie den Namen für das neue Lesezeichen ein movieplayer.chapters Kapitel movieplayer.display_playtime Zeige Spielzeit im VFD/LCD +movieplayer.eof_cnt EOF Wiederholungen nach Serverabbruch (WebTV) movieplayer.fileplayback_audio Multiformat-Audiowiedergabe movieplayer.fileplayback_video Multiformat-Videowiedergabe movieplayer.head Movieplayer diff --git a/data/locale/english.locale b/data/locale/english.locale index 28dea75ad..34166a570 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1875,6 +1875,7 @@ movieplayer.bookmarkname_hint1 New bookmark movieplayer.bookmarkname_hint2 Enter a name for your new bookmark movieplayer.chapters Chapters movieplayer.display_playtime Show playtime in VFD +movieplayer.eof_cnt EOF Retries after lost server connection (WebTV) movieplayer.fileplayback_audio Multiformat audio playback movieplayer.fileplayback_video Multiformat video playback movieplayer.head Movieplayer diff --git a/src/gui/mediaplayer_setup.cpp b/src/gui/mediaplayer_setup.cpp index 95b77fa6b..dcb447186 100644 --- a/src/gui/mediaplayer_setup.cpp +++ b/src/gui/mediaplayer_setup.cpp @@ -157,6 +157,10 @@ int CMediaPlayerSetup::showMediaPlayerSetup() mc->setHint("", LOCALE_MENU_HINT_MOVIEPLAYER_DISPLAY_PLAYTIME); mediaSetup->addItem(mc); + CMenuOptionNumberChooser * ef = new CMenuOptionNumberChooser(LOCALE_MOVIEPLAYER_EOF_CNT, &g_settings.eof_cnt, true, 1, 10, NULL); +// ef->setHint("", LOCALE_MENU_HINT_MOVIEPLAYER_EOF_CNT); + mediaSetup->addItem(ef); + int res = mediaSetup->exec (NULL, ""); selected = mediaSetup->getSelected(); delete mediaSetup; diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 6b73b9ede..0026105a1 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -897,15 +897,15 @@ void* CMoviePlayerGui::bgPlayThread(void *arg) mutex.unlock(); int eof = 0, pos = 0; - int eof_max = mp->isWebChannel ? 1 : 5; -#if defined (BOXMODEL_VUPLUS_ARM) - eof_max = 0; -#endif + int eof_max = mp->isWebChannel ? g_settings.eof_cnt : 5; while(webtv_started) { if (mp->playback->GetPosition(mp->position, mp->duration, mp->isWebChannel)) { if (pos == mp->position) + { eof++; + printf("CMoviePlayerGui::bgPlayThread: eof counter: %d\n", eof); + } else eof = 0; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index ef9c50346..b84540a05 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1024,6 +1024,7 @@ if (g_info.hw_caps->can_shutdown) #else g_settings.movieplayer_display_playtime = configfile.getInt32("movieplayer_display_playtime", 0); #endif + g_settings.eof_cnt = configfile.getInt32("movieplayer_eof_cnt", 1); #ifdef TMDB_API_KEY g_settings.tmdb_api_key = TMDB_API_KEY; @@ -1697,6 +1698,7 @@ void CNeutrinoApp::saveSetup(const char * fname) //Movie-Player configfile.setInt32( "movieplayer_repeat_on", g_settings.movieplayer_repeat_on ); configfile.setInt32( "movieplayer_display_playtime", g_settings.movieplayer_display_playtime ); + configfile.setInt32( "movieplayer_eof_cnt", g_settings.eof_cnt ); #ifndef TMDB_API_KEY configfile.setString( "tmdb_api_key", g_settings.tmdb_api_key ); #endif diff --git a/src/system/locals.h b/src/system/locals.h index 965755acd..3e0523203 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1902,6 +1902,7 @@ typedef enum LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT2, LOCALE_MOVIEPLAYER_CHAPTERS, LOCALE_MOVIEPLAYER_DISPLAY_PLAYTIME, + LOCALE_MOVIEPLAYER_EOF_CNT, LOCALE_MOVIEPLAYER_FILEPLAYBACK_AUDIO, LOCALE_MOVIEPLAYER_FILEPLAYBACK_VIDEO, LOCALE_MOVIEPLAYER_HEAD, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index d8128531c..234958e03 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1902,6 +1902,7 @@ const char *locale_real_names[] = "movieplayer.bookmarkname_hint2", "movieplayer.chapters", "movieplayer.display_playtime", + "movieplayer.eof_cnt", "movieplayer.fileplayback_audio", "movieplayer.fileplayback_video", "movieplayer.head", diff --git a/src/system/settings.h b/src/system/settings.h index e696b6447..c0a15c5f2 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -867,13 +867,13 @@ struct SNeutrinoSettings int picviewer_scaling; //audioplayer - int audioplayer_display; - int audioplayer_follow; - int audioplayer_highprio; - int audioplayer_select_title_by_name; - int audioplayer_repeat_on; - int audioplayer_show_playlist; - int audioplayer_enable_sc_metadata; + int audioplayer_display; + int audioplayer_follow; + int audioplayer_highprio; + int audioplayer_select_title_by_name; + int audioplayer_repeat_on; + int audioplayer_show_playlist; + int audioplayer_enable_sc_metadata; std::string shoutcast_dev_id; int shoutcast_enabled; @@ -884,10 +884,11 @@ struct SNeutrinoSettings int filebrowser_use_filter; //movieplayer - int movieplayer_repeat_on; + int movieplayer_repeat_on; int movieplayer_display_playtime; std::string tmdb_api_key; int tmdb_enabled; + int eof_cnt; //zapit setup std::string StartChannelTV;