[PATCH] fbdev: fix check on nanosleep return vale
Stefano Sabatini
stefano.sabatini-lala
Sat Mar 12 14:46:16 CET 2011
In fbdev_read_packet(): nanosleep returns -1 in case of errors,
the EINTR check has to be done on errno.
Spotted by Nicolas.
---
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)
--
1.7.2.3
--ew6BAiZeqk4r7MaW--
More information about the ffmpeg-devel
mailing list