[vlc-commits] stream_demux: remove peek callback

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


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jul 23 21:06:08 2015 +0300| [dc759af054be1250ff29b2f4f6486d807e54e371] | committer: Rémi Denis-Courmont

stream_demux: remove peek callback

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

 src/input/stream_demux.c |   40 ----------------------------------------
 1 file changed, 40 deletions(-)

diff --git a/src/input/stream_demux.c b/src/input/stream_demux.c
index 9bf3343..9457ecd 100644
--- a/src/input/stream_demux.c
+++ b/src/input/stream_demux.c
@@ -58,7 +58,6 @@ struct stream_sys_t
 };
 
 static int  DStreamRead   ( stream_t *, void *p_read, unsigned int i_read );
-static int  DStreamPeek   ( stream_t *, const uint8_t **pp_peek, unsigned int i_peek );
 static int  DStreamControl( stream_t *, int i_query, va_list );
 static void DStreamDelete ( stream_t * );
 static void* DStreamThread ( void * );
@@ -77,7 +76,6 @@ stream_t *stream_DemuxNew( demux_t *p_demux, const char *psz_demux, es_out_t *ou
     s->p_input = p_demux->p_input;
     s->psz_path  = strdup(""); /* N/A */
     s->pf_read   = DStreamRead;
-    s->pf_peek   = DStreamPeek;
     s->pf_control= DStreamControl;
     s->pf_destroy= DStreamDelete;
 
@@ -217,44 +215,6 @@ static int DStreamRead( stream_t *s, void *p_read, unsigned int i_read )
     return i_out;
 }
 
-static int DStreamPeek( stream_t *s, const uint8_t **pp_peek, unsigned int i_peek )
-{
-    stream_sys_t *p_sys = s->p_sys;
-    block_t **pp_block = &p_sys->p_block;
-    int i_out = 0;
-    *pp_peek = 0;
-
-    //msg_Dbg( s, "DStreamPeek: wanted %d bytes", i_peek );
-
-    while( atomic_load( &p_sys->active ) && !s->b_error && i_peek )
-    {
-        int i_copy;
-
-        if( !*pp_block )
-        {
-            *pp_block = block_FifoGet( p_sys->p_fifo );
-            if( !*pp_block ) s->b_error = 1;
-        }
-
-        if( *pp_block && i_peek )
-        {
-            i_copy = __MIN( i_peek, (*pp_block)->i_buffer );
-            i_peek -= i_copy;
-            i_out += i_copy;
-
-            if( i_peek ) pp_block = &(*pp_block)->p_next;
-        }
-    }
-
-    if( p_sys->p_block )
-    {
-        p_sys->p_block = block_ChainGather( p_sys->p_block );
-        *pp_peek = p_sys->p_block->p_buffer;
-    }
-
-    return i_out;
-}
-
 static int DStreamControl( stream_t *s, int i_query, va_list args )
 {
     stream_sys_t *p_sys = s->p_sys;



More information about the vlc-commits mailing list