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@gmx.at>
oldabi
Stefano Sabatini 14 years ago committed by Michael Niedermayer
parent 57d63d43cf
commit 478607668c
  1. 2
      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)

Loading…
Cancel
Save