[vlc-commits] cache: fix seek when skipping data
Thomas Guillem
git at videolan.org
Tue Oct 6 09:51:43 CEST 2015
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Oct 6 09:47:02 2015 +0200| [4a55d147cd0c2fa53b11e34e4da5ef77f7d31a78] | committer: Thomas Guillem
cache: fix seek when skipping data
AStreamReadNoSeekStream can return a value less than the length argument
without failing.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4a55d147cd0c2fa53b11e34e4da5ef77f7d31a78
---
modules/stream_filter/cache_read.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules/stream_filter/cache_read.c b/modules/stream_filter/cache_read.c
index fbe0e9a..5a32433 100644
--- a/modules/stream_filter/cache_read.c
+++ b/modules/stream_filter/cache_read.c
@@ -401,7 +401,8 @@ static int AStreamSeekStream(stream_t *s, uint64_t i_pos)
while (i_skip > 0)
{
const int i_read_max = __MIN(10 * STREAM_READ_ATONCE, i_skip);
- if (AStreamReadNoSeekStream(s, NULL, i_read_max) != i_read_max)
+ int i_read = 0;
+ if ((i_read = AStreamReadNoSeekStream(s, NULL, i_read_max)) <= 0)
return VLC_EGENERIC;
i_skip -= i_read_max;
}
More information about the vlc-commits
mailing list