[vlc-devel] [PATCH] stream: stop peeking when reading returns 0

Steve Lhomme robux4 at gmail.com
Tue Aug 25 10:53:53 CEST 2015


--
when stream_Read() uses the peeked data, it asserts if the buffered size is 0
---
 src/input/stream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/input/stream.c b/src/input/stream.c
index d08a55c..6f9c80d 100644
--- a/src/input/stream.c
+++ b/src/input/stream.c
@@ -386,7 +386,7 @@ ssize_t stream_Peek(stream_t *s, const uint8_t **restrict bufp, size_t len)
         }
 
         ssize_t ret = s->pf_read(s, peek->p_buffer, len);
-        if (ret < 0)
+        if (ret <= 0)
         {
             block_Release(peek);
             return ret;
-- 
2.5.0



More information about the vlc-devel mailing list