movieplayer: fix updateposition loop

This commit is contained in:
TangoCash
2017-10-28 20:24:53 +02:00
committed by Thilo Graf
parent 9de80e58ee
commit 5151172a93

View File

@@ -2556,14 +2556,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::showHelp() void CMoviePlayerGui::showHelp()