[vlc-commits] zip: remove suspicious peek callback

Rémi Denis-Courmont git at videolan.org
Thu Jul 23 20:09:29 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jul 23 20:54:18 2015 +0300| [d2b8c6dc91f8dd524d0053f5e6e5367474741bd0] | committer: Rémi Denis-Courmont

zip: remove suspicious peek callback

(The read callback is as suspicious and retained.)

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

 modules/access/rar/stream.c    |    6 ------
 modules/access/zip/zipstream.c |   20 --------------------
 2 files changed, 26 deletions(-)

diff --git a/modules/access/rar/stream.c b/modules/access/rar/stream.c
index 4a4c761..7e5ae7d 100644
--- a/modules/access/rar/stream.c
+++ b/modules/access/rar/stream.c
@@ -44,11 +44,6 @@ static int Read(stream_t *s, void *data, unsigned size)
     return stream_Read(s->p_sys->payload, data, size);
 }
 
-static int Peek( stream_t *s, const uint8_t **data, unsigned size)
-{
-    return stream_Peek(s->p_sys->payload, data, size);
-}
-
 static int Control(stream_t *s, int query, va_list args)
 {
     switch (query) {
@@ -145,7 +140,6 @@ int RarStreamOpen(vlc_object_t *object)
     }
 
     s->pf_read = Read;
-    s->pf_peek = Peek;
     s->pf_control = Control;
 
     stream_sys_t *sys = s->p_sys = malloc(sizeof(*sys));
diff --git a/modules/access/zip/zipstream.c b/modules/access/zip/zipstream.c
index b2199f9..8286e98 100644
--- a/modules/access/zip/zipstream.c
+++ b/modules/access/zip/zipstream.c
@@ -54,7 +54,6 @@ vlc_module_end()
  * Local prototypes
  ****************************************************************************/
 static int Read   ( stream_t *, void *p_read, unsigned int i_read );
-static int Peek   ( stream_t *, const uint8_t **pp_peek, unsigned int i_peek );
 static int Control( stream_t *, int i_query, va_list );
 
 typedef struct node node;
@@ -184,7 +183,6 @@ int StreamOpen( vlc_object_t *p_this )
         return VLC_ENOMEM;
 
     s->pf_read = Read;
-    s->pf_peek = Peek;
     s->pf_control = Control;
 
     p_sys->fileFunctions = ( zlib_filefunc_def * )
@@ -267,24 +265,6 @@ static int Read( stream_t *s, void *p_read, unsigned int i_read )
 }
 
 /** *************************************************************************
- * Peek
- ****************************************************************************/
-static int Peek( stream_t *s, const uint8_t **pp_peek, unsigned int i_peek )
-{
-    stream_sys_t *p_sys = s->p_sys;
-
-    /* Fill the buffer */
-    if( Fill( s ) )
-        return -1;
-
-    /* Point to the buffer */
-    int i_len = __MIN( i_peek, p_sys->i_len - p_sys->i_pos );
-    *pp_peek = (uint8_t*) p_sys->psz_xspf + p_sys->i_pos;
-
-    return i_len;
-}
-
-/** *************************************************************************
  * Control
  ****************************************************************************/
 static int Control( stream_t *s, int i_query, va_list args )



More information about the vlc-commits mailing list