[FFmpeg-cvslog] fbdev: fix check on nanosleep return vale

Stefano Sabatini git
Sun Mar 13 02:09:34 CET 2011


ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Sat Mar 12 14:46:16 2011 +0100| [478607668c8840278c3fdd97382c3fae3f8cd7a2] | committer: Michael Niedermayer

fbdev: fix check on nanosleep return vale

In fbdev_read_packet(): nanosleep returns -1 in case of errors,
the EINTR check has to be done on errno.

Spotted by Nicolas.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=478607668c8840278c3fdd97382c3fae3f8cd7a2
---

 libavdevice/fbdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavdevice/fbdev.c b/libavdevice/fbdev.c
index 0c282f4..121f02c 100644
--- a/libavdevice/fbdev.c
+++ b/libavdevice/fbdev.c
@@ -204,7 +204,7 @@ static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt)
             return AVERROR(EAGAIN);
         ts.tv_sec  =  delay / 1000000;
         ts.tv_nsec = (delay % 1000000) * 1000;
-        while (nanosleep(&ts, &ts) == EINTR);
+        while (nanosleep(&ts, &ts) < 0 && errno == EINTR);
     }
 
     if ((ret = av_new_packet(pkt, fbdev->frame_size)) < 0)




More information about the ffmpeg-cvslog mailing list