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

Thomas Guillem git at videolan.org
Thu Oct 22 11:01:32 CEST 2015


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Oct 21 12:04:09 2015 +0200| [1abea4749145807d3163d46a4db953149d0b2fd3] | committer: Thomas Guillem

cache_read: don't fail when skipping at EOF

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1abea4749145807d3163d46a4db953149d0b2fd3
---

 modules/stream_filter/cache_read.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/stream_filter/cache_read.c b/modules/stream_filter/cache_read.c
index ee21d7c..8cee673 100644
--- a/modules/stream_filter/cache_read.c
+++ b/modules/stream_filter/cache_read.c
@@ -399,11 +399,12 @@ 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)
+                    return VLC_SUCCESS; /* EOF */
                 i_skip -= i_read_max;
             }
         }



More information about the vlc-commits mailing list