movieplayer: fix updateposition loop

Origin commit data
------------------
Branch: ni/coolstream
Commit: af6f850ded
Author: TangoCash <eric@loxat.de>
Date: 2017-10-28 (Sat, 28 Oct 2017)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
TangoCash
2017-10-28 20:24:53 +02:00
committed by vanhofen
parent 03d48a1631
commit 75996da1fb

View File

@@ -2807,14 +2807,20 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/)
void CMoviePlayerGui::UpdatePosition() void CMoviePlayerGui::UpdatePosition()
{ {
while (!playback->GetPosition(position, duration)) { int cnt = 0;
if (duration > 100) do
file_prozent = (unsigned char) (position / (duration / 100)); {
FileTimeOSD->update(position, duration); usleep(10000);
#ifdef DEBUG cnt++;
printf("CMoviePlayerGui::%s: spd %d pos %d/%d (%d, %d%%)\n", __func__, speed, position, duration, duration-position, file_prozent);
#endif
} }
while ((!playback->GetPosition(position, duration)) || (cnt <= 5));
if (duration > 100)
file_prozent = (unsigned char) (position / (duration / 100));
FileTimeOSD->update(position, duration);
#ifdef DEBUG
printf("CMoviePlayerGui::%s: spd %d pos %d/%d (%d, %d%%)\n", __func__, speed, position, duration, duration-position, file_prozent);
#endif
} }
void CMoviePlayerGui::StopSubtitles(bool enable_glcd_mirroring __attribute__((unused))) void CMoviePlayerGui::StopSubtitles(bool enable_glcd_mirroring __attribute__((unused)))