Skip to content

Commit

Permalink
new option added for eof retries on lost server connections
Browse files Browse the repository at this point in the history
  • Loading branch information
BPanther authored and vanhofen committed Jul 26, 2023
1 parent aac826b commit b11a1de
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions data/locale/deutsch.locale
Expand Up @@ -2291,6 +2291,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/WebRadio)
movieplayer.fileplayback_audio Multiformat-Audiowiedergabe
movieplayer.fileplayback_video Multiformat-Videowiedergabe
movieplayer.head Movieplayer
Expand Down
1 change: 1 addition & 0 deletions data/locale/english.locale
Expand Up @@ -2291,6 +2291,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 repetitions after lost server connection (WebTV/WebRadio)
movieplayer.fileplayback_audio Multiformat audio playback
movieplayer.fileplayback_video Multiformat video playback
movieplayer.head Movieplayer
Expand Down
6 changes: 6 additions & 0 deletions src/gui/mediaplayer_setup.cpp
Expand Up @@ -133,6 +133,12 @@ int CMediaPlayerSetup::showMediaPlayerSetup()
mc->setHint("", LOCALE_MENU_HINT_MOVIEPLAYER_TIMEOSD_WHILE_SEARCHING);
mediaSetup->addItem(mc);

mediaSetup->addItem(GenericMenuSeparator);

CMenuOptionNumberChooser *ef = new CMenuOptionNumberChooser(LOCALE_MOVIEPLAYER_EOF_CNT, &g_settings.movieplayer_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;
Expand Down
8 changes: 4 additions & 4 deletions src/gui/movieplayer.cpp
Expand Up @@ -1001,18 +1001,18 @@ 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.movieplayer_eof_cnt : 5;

while(webtv_started) {
if (mp->playback->GetPosition(mp->position, mp->duration, mp->isWebChannel)) {
#if 0
printf("CMoviePlayerGui::bgPlayThread: position %d duration %d (%d)\n", mp->position, mp->duration, mp->duration-mp->position);
#endif
if (pos == mp->position && mp->duration > 0)
{
eof++;
printf("CMoviePlayerGui::bgPlayThread: eof counter: %d\n", eof);
}
else
eof = 0;

Expand Down
2 changes: 2 additions & 0 deletions src/neutrino.cpp
Expand Up @@ -1210,6 +1210,7 @@ int CNeutrinoApp::loadSetup(const char *fname)
// movieplayer
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_eof_cnt = configfile.getInt32("movieplayer_eof_cnt", 1);
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);
Expand Down Expand Up @@ -2098,6 +2099,7 @@ void CNeutrinoApp::saveSetup(const char *fname)
// movieplayer
configfile.setInt32("movieplayer_bisection_jump", g_settings.movieplayer_bisection_jump);
configfile.setInt32("movieplayer_display_playtime", g_settings.movieplayer_display_playtime);
configfile.setInt32("movieplayer_eof_cnt", g_settings.movieplayer_eof_cnt);
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);
Expand Down
1 change: 1 addition & 0 deletions src/system/locals.h
Expand Up @@ -2318,6 +2318,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,
Expand Down
1 change: 1 addition & 0 deletions src/system/locals_intern.h
Expand Up @@ -2318,6 +2318,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",
Expand Down
1 change: 1 addition & 0 deletions src/system/settings.h
Expand Up @@ -1013,6 +1013,7 @@ struct SNeutrinoSettings
// movieplayer
int movieplayer_bisection_jump;
int movieplayer_display_playtime;
int movieplayer_eof_cnt;
int movieplayer_repeat_on;
#if HAVE_CST_HARDWARE
bool movieplayer_select_ac3_atype0;
Expand Down

0 comments on commit b11a1de

Please sign in to comment.