movieplayer: fix updateposition loop

Origin commit data
------------------
Commit: af6f850ded
Author: TangoCash <eric@loxat.de>
Date: 2017-10-28 (Sat, 28 Oct 2017)
This commit is contained in:
TangoCash
2017-10-28 20:24:53 +02:00
committed by vanhofen
parent 67c6a6d8cb
commit 429aba8352

View File

@@ -2807,7 +2807,14 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/)
void CMoviePlayerGui::UpdatePosition()
{
while (!playback->GetPosition(position, duration)) {
int cnt = 0;
do
{
usleep(10000);
cnt++;
}
while ((!playback->GetPosition(position, duration)) || (cnt <= 5));
if (duration > 100)
file_prozent = (unsigned char) (position / (duration / 100));
FileTimeOSD->update(position, duration);
@@ -2815,7 +2822,6 @@ void CMoviePlayerGui::UpdatePosition()
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)))
{