mplayer.c: more thoroughly check rtc return value.
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sun, 14 Feb 2016 14:37:58 +0000 (14:37 +0000)
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sun, 14 Feb 2016 14:37:58 +0000 (14:37 +0000)
git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@37729 b3059339-0415-0410-9bf9-f77b7e298cf2

mplayer.c

index aa5ca33..1165d72 100644 (file)
--- a/mplayer.c
+++ b/mplayer.c
@@ -1839,7 +1839,7 @@ static float timing_sleep(float time_frame)
         current_module = "sleep_rtc";
         while (time_frame > 0.000) {
             unsigned long rtc_ts;
-            if (read(rtc_fd, &rtc_ts, sizeof(rtc_ts)) <= 0)
+            if (read(rtc_fd, &rtc_ts, sizeof(rtc_ts)) != sizeof(rtc_ts))
                 mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_LinuxRTCReadError, strerror(errno));
             time_frame -= GetRelativeTime();
         }