Skip to content

Commit

Permalink
reload webtv/iptv stream if connection lost
Browse files Browse the repository at this point in the history
  • Loading branch information
BPanther committed Jul 15, 2023
1 parent aac2557 commit 46813c0
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/gui/movieplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,11 +898,24 @@ void* CMoviePlayerGui::bgPlayThread(void *arg)
mutex.unlock();

while(webtv_started) {
if (mp->playback->GetPosition(mp->position, mp->duration)) {
if (mp->playback->GetPosition(mp->position, mp->duration, mp->isWebChannel)) {
if (pos == mp->position)
eof++;
if (mp->isWebChannel)
#if defined (BOXMODEL_VUPLUS_ARM)
eof = 6;
#else
{
if (eof == 5)
eof = 6;
else
eof = 5;
}
#endif
else
eof++;
else
eof = 0;

if (eof > 5) {
printf("CMoviePlayerGui::bgPlayThread: playback stopped, try to rezap...\n");
g_RCInput->postMsg(NeutrinoMessages::EVT_WEBTV_ZAP_COMPLETE, (neutrino_msg_data_t) chid);
Expand Down Expand Up @@ -1419,7 +1432,7 @@ bool CMoviePlayerGui::PlayFileStart(void)
towait = 20;
}
for(i = 0; i < cnt; i++) {
playback->GetPosition(position, duration);
playback->GetPosition(position, duration, isWebChannel);
startposition = (duration - position);

//printf("CMoviePlayerGui::PlayFile: waiting for data, position %d duration %d (%d), start %d\n", position, duration, towait, startposition);
Expand Down Expand Up @@ -1594,7 +1607,7 @@ void CMoviePlayerGui::PlayFileLoop(void)


if ((playstate >= CMoviePlayerGui::PLAY) && (timeshift != TSHIFT_MODE_OFF || (playstate != CMoviePlayerGui::PAUSE))) {
if (playback->GetPosition(position, duration)) {
if (playback->GetPosition(position, duration, isWebChannel)) {
FileTimeOSD->update(position, duration);
if (duration > 100)
file_prozent = (unsigned char) (position / (duration / 100));
Expand Down Expand Up @@ -1891,7 +1904,7 @@ void CMoviePlayerGui::PlayFileLoop(void)
handleMovieBrowser(CRCInput::RC_0, position);
} else if (msg == (neutrino_msg_t) g_settings.mpkey_goto) {
bool cancel = true;
playback->GetPosition(position, duration);
playback->GetPosition(position, duration, isWebChannel);
int ss = position/1000;
int hh = ss/3600;
ss -= hh * 3600;
Expand Down Expand Up @@ -2546,7 +2559,7 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/)

void CMoviePlayerGui::UpdatePosition()
{
if (!playback->GetPosition(position, duration)) {
if (!playback->GetPosition(position, duration, isWebChannel)) {
if ((position > duration && g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_RADIO] == 0 && IsAudioPlaying()) || \
(position > duration && g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR_MOVIE] == 0 && !IsAudioPlaying()))
g_RCInput->postMsg (CRCInput::RC_home, 0);
Expand Down

0 comments on commit 46813c0

Please sign in to comment.