Commit dc759af0 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

stream_demux: remove peek callback

parent c88a5394
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment