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;
}
#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 */
/**
{
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 );
/* 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;
{
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;
}