changeset 20486:0cc36dd385ec

fixed mishandling of stream_read() (it doesn't necessarily return -1 in case of error)
author nicodvb
date Sun, 29 Oct 2006 10:33:49 +0000
parents 8fb92804c652
children 5c953a55103f
files libmpdemux/demux_ts.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ts.c	Sun Oct 29 10:23:15 2006 +0000
+++ b/libmpdemux/demux_ts.c	Sun Oct 29 10:33:49 2006 +0000
@@ -2827,10 +2827,10 @@
 			p = &((*dp)->buffer[*dp_offset]);
 		}
 
-		buf_size = stream_read(stream, p, buf_size);
-		if(buf_size==-1)
+		len = stream_read(stream, p, buf_size);
+		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;
 		}
 		stream_skip(stream, junk);