fixed mishandling of stream_read() (it doesn't necessarily return -1 in case of error)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20502 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
nicodvb 2006-10-29 10:33:49 +00:00
parent e534b4afa9
commit 4ea549d06f
1 changed files with 3 additions and 3 deletions

View File

@ -2827,10 +2827,10 @@ static int ts_parse(demuxer_t *demuxer , ES_stream_t *es, unsigned char *packet,
p = &((*dp)->buffer[*dp_offset]); p = &((*dp)->buffer[*dp_offset]);
} }
buf_size = stream_read(stream, p, buf_size); len = stream_read(stream, p, buf_size);
if(buf_size==-1) if(len < buf_size)
{ {
mp_msg(MSGT_DEMUX, MSGL_DBG2, "\r\nts_parse() couldn't read data\r\n"); mp_msg(MSGT_DEMUX, MSGL_DBG2, "\r\nts_parse() couldn't read enough data: %d < %d\r\n", len, buf_size);
continue; continue;
} }
stream_skip(stream, junk); stream_skip(stream, junk);