[vlc-commits] input: fix skipping data in stream-oriented access

Rémi Denis-Courmont git at videolan.org
Sun Jul 10 19:46:37 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 10 17:36:00 2016 +0300| [f9c09233e3c549e6a9c040c8a743f511b5fd239d] | committer: Rémi Denis-Courmont

input: fix skipping data in stream-oriented access

Now that stream cache and stream/access wrapper are separated the later
must handle skipping data (by "reading into" a NULL buffer). This was
done correctly for block-oriented plugins, but not stream-oriented
ones. This patch simply adds a dummy buffer to read into in the
unlikely event that it is needed.

(Typically one of the stream cache plugins takes care of this, so this
bug was mostly invisible.)

Pointed-out-by: Filip Roséen <filip at videolabs.io>

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

 src/input/access.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/input/access.c b/src/input/access.c
index e7df2ee..fff3d64 100644
--- a/src/input/access.c
+++ b/src/input/access.c
@@ -254,6 +254,13 @@ static ssize_t AStreamReadStream(stream_t *s, void *buf, size_t len)
     stream_sys_t *sys = s->p_sys;
     input_thread_t *input = s->p_input;
     ssize_t val = 0;
+    char dummy[(buf != NULL) ? 1 : (len <= 2048) ? len : 2048];
+
+    if (buf == NULL)
+    {
+        buf = dummy;
+        len = sizeof (dummy);
+    }
 
     do
     {



More information about the vlc-commits mailing list