[vlc-commits] decomp: avoid unreliable waitall mode of net_Read()
Rémi Denis-Courmont
git at videolan.org
Sun Jul 21 18:47:12 CEST 2013
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 21 19:08:39 2013 +0300| [0dce21c6a4ad47d46d141a4741ea3f0190f38426] | committer: Rémi Denis-Courmont
decomp: avoid unreliable waitall mode of net_Read()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0dce21c6a4ad47d46d141a4741ea3f0190f38426
---
modules/stream_filter/decomp.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/modules/stream_filter/decomp.c b/modules/stream_filter/decomp.c
index 5a12e87..3a421e1 100644
--- a/modules/stream_filter/decomp.c
+++ b/modules/stream_filter/decomp.c
@@ -237,15 +237,14 @@ static int Peek (stream_t *stream, const uint8_t **pbuf, unsigned int len)
if ((p_sys->peeked = peeked) == NULL)
return 0;
- if (curlen < len)
+ while (curlen < len)
{
ssize_t val = net_Read (stream, fd, NULL, peeked->p_buffer + curlen,
- len - curlen, true);
- if (val >= 0)
- {
- curlen += val;
- peeked->i_buffer = curlen;
- }
+ len - curlen, false);
+ if (val <= 0)
+ break;
+ curlen += val;
+ peeked->i_buffer = curlen;
}
*pbuf = peeked->p_buffer;
return curlen;
More information about the vlc-commits
mailing list