mirror of https://github.com/mpv-player/mpv
check the result of poll() before read()ing; 100l
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15214 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
dbb001bae2
commit
cd57606202
|
@ -404,14 +404,8 @@ static int dvb_streaming_read(stream_t *stream, char *buffer, int size)
|
|||
pfds[0].fd = fd;
|
||||
pfds[0].events = POLLIN | POLLPRI;
|
||||
|
||||
poll(pfds, 1, 500);
|
||||
rk = size - pos;
|
||||
if((rk = read(fd, &buffer[pos], rk)) > 0)
|
||||
{
|
||||
pos += rk;
|
||||
mp_msg(MSGT_DEMUX, MSGL_DBG3, "ret (%d) bytes\n", pos);
|
||||
}
|
||||
else
|
||||
if(poll(pfds, 1, 500) <= 0)
|
||||
{
|
||||
errno = 0;
|
||||
mp_msg(MSGT_DEMUX, MSGL_ERR, "dvb_streaming_read, attempt N. %d failed with errno %d when reading %d bytes\n", tries, errno, size-pos);
|
||||
|
@ -420,7 +414,13 @@ static int dvb_streaming_read(stream_t *stream, char *buffer, int size)
|
|||
else
|
||||
break;
|
||||
}
|
||||
if((rk = read(fd, &buffer[pos], rk)) > 0)
|
||||
{
|
||||
pos += rk;
|
||||
mp_msg(MSGT_DEMUX, MSGL_DBG3, "ret (%d) bytes\n", pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(! pos)
|
||||
mp_msg(MSGT_DEMUX, MSGL_ERR, "dvb_streaming_read, return %d bytes\n", pos);
|
||||
|
|
Loading…
Reference in New Issue