[vlc-devel] [PATCH] cache_read: don't fail when skipping at EOF

Thomas Guillem thomas at gllm.fr
Wed Oct 21 12:15:14 CEST 2015


---
 modules/stream_filter/cache_read.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/stream_filter/cache_read.c b/modules/stream_filter/cache_read.c
index 78dcdf0..1a3fc43 100644
--- a/modules/stream_filter/cache_read.c
+++ b/modules/stream_filter/cache_read.c
@@ -399,10 +399,15 @@ static int AStreamSeekStream(stream_t *s, uint64_t i_pos)
             {
                 const int i_read_max = __MIN(10 * STREAM_READ_ATONCE, i_skip);
                 int i_read = 0;
-                if ((i_read = AStreamReadNoSeekStream(s, NULL, i_read_max)) <= 0)
+                if ((i_read = AStreamReadNoSeekStream(s, NULL, i_read_max)) < 0)
                 {
                     msg_Err(s, "AStreamSeekStream: skip failed");
                     return VLC_EGENERIC;
+                } else if (i_read == 0)
+                {
+                    msg_Dbg(s, "AStreamSeekStream: EOF");
+                    i_pos = tk->i_end;
+                    break;
                 }
                 i_skip -= i_read_max;
             }
-- 
2.1.4



More information about the vlc-devel mailing list