Commit 1a539b89 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove dummy stream_t.pf_block

parent 11edc20c
......@@ -312,7 +312,6 @@ stream_t *__stream_DemuxNew( vlc_object_t *p_obj, const char *psz_demux,
if( psz_demux == NULL || *psz_demux == '\0' ) return NULL;
s = vlc_stream_create( p_obj );
s->pf_block = NULL;
s->pf_read = DStreamRead;
s->pf_peek = DStreamPeek;
s->pf_control= DStreamControl;
......
......@@ -353,7 +353,7 @@ static inline int demux2_Control( demux_t *p_demux, int i_query, ... )
}
#if defined(__PLUGIN__) || defined(__BUILTIN__)
# warning This is an internal header, please don't rely on it.
# warning This is an internal header, something is wrong if you see this message.
#else
/* Stream */
/**
......@@ -363,7 +363,7 @@ struct stream_t
{
VLC_COMMON_MEMBERS
block_t *(*pf_block) ( stream_t *, int i_size );
/*block_t *(*pf_block) ( stream_t *, int i_size );*/
int (*pf_read) ( stream_t *, void *p_read, int i_read );
int (*pf_peek) ( stream_t *, const uint8_t **pp_peek, int i_peek );
int (*pf_control)( stream_t *, int i_query, va_list );
......
......@@ -63,7 +63,6 @@ stream_t *__stream_MemoryNew( vlc_object_t *p_this, uint8_t *p_buffer,
p_sys->p_buffer = p_buffer;
p_sys->i_preserve_memory = i_preserve_memory;
s->pf_block = NULL;
s->pf_read = Read;
s->pf_peek = Peek;
s->pf_control = Control;
......
......@@ -232,7 +232,6 @@ stream_t *stream_AccessNew( access_t *p_access, vlc_bool_t b_quick )
/* Attach it now, needed for b_die */
vlc_object_attach( s, p_access );
s->pf_block = NULL;
s->pf_read = NULL; /* Set up later */
s->pf_peek = NULL;
s->pf_control = AStreamControl;
......@@ -1883,23 +1882,16 @@ block_t *stream_Block( stream_t *s, int i_size )
{
if( i_size <= 0 ) return NULL;
if( s->pf_block )
/* emulate block read */
block_t *p_bk = block_New( s, i_size );
if( p_bk )
{
return s->pf_block( s, i_size );
}
else
{
/* emulate block read */
block_t *p_bk = block_New( s, i_size );
if( p_bk )
p_bk->i_buffer = stream_Read( s, p_bk->p_buffer, i_size );
if( p_bk->i_buffer > 0 )
{
p_bk->i_buffer = stream_Read( s, p_bk->p_buffer, i_size );
if( p_bk->i_buffer > 0 )
{
return p_bk;
}
return p_bk;
}
if( p_bk ) block_Release( p_bk );
return NULL;
}
if( p_bk ) block_Release( p_bk );
return NULL;
}
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