[vlc-commits] prefetch: add support for block-based accesses

Rémi Denis-Courmont git at videolan.org
Thu Jul 21 21:30:19 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jul 21 21:55:01 2016 +0300| [6a3c9b1d4af28a171d8262f5bda0a0c595844614] | committer: Rémi Denis-Courmont

prefetch: add support for block-based accesses

This still requires memory copying, but at least it does not introduce
timing issues.

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

 modules/stream_filter/prefetch.c |    2 +-
 src/input/access.c               |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/stream_filter/prefetch.c b/modules/stream_filter/prefetch.c
index d0f877c..f7cf4cb 100644
--- a/modules/stream_filter/prefetch.c
+++ b/modules/stream_filter/prefetch.c
@@ -92,7 +92,7 @@ static int ThreadRead(stream_t *stream, size_t length)
 
     char *p = sys->buffer + (sys->buffer_offset % sys->buffer_size)
                           + sys->buffer_length;
-    ssize_t val = vlc_stream_Read(stream->p_source, p, length);
+    ssize_t val = vlc_stream_ReadPartial(stream->p_source, p, length);
 
     if (val < 0)
         msg_Err(stream, "cannot read data (at offset %"PRIu64")",
diff --git a/src/input/access.c b/src/input/access.c
index b64cc19..cc6d625 100644
--- a/src/input/access.c
+++ b/src/input/access.c
@@ -317,7 +317,7 @@ stream_t *stream_AccessNew(vlc_object_t *parent, input_thread_t *input,
     if (access->pf_block != NULL)
     {
         s->pf_block = AStreamReadBlock;
-        cachename = "cache_block";
+        cachename = "prefetch,cache_block";
     }
     else
     if (access->pf_read != NULL)



More information about the vlc-commits mailing list