****************************************************************************/
stream_t *stream_CommonNew( vlc_object_t *p_obj )
{
- stream_t *s = (stream_t *)vlc_custom_create( p_obj, sizeof(*s),
- VLC_OBJECT_GENERIC, "stream" );
+ stream_t *s = (stream_t *)vlc_custom_create( p_obj, sizeof(*s), "stream" );
if( !s )
return NULL;
vlc_iconv_close( s->p_text->conv );
free( s->p_text );
}
+ free( s->psz_access );
free( s->psz_path );
vlc_object_release( s );
}
strcpy( psz_dup, psz_url );
input_SplitMRL( &psz_access, &psz_demux, &psz_path, psz_dup );
- /* Get a weak link to the parent input */
- /* FIXME: This should probably be removed in favor of a NULL input. */
- input_thread_t *p_input = (input_thread_t *)vlc_object_find( p_parent, VLC_OBJECT_INPUT, FIND_PARENT );
-
/* Now try a real access */
- p_access = access_New( p_parent, p_input, psz_access, psz_demux, psz_path );
-
- if(p_input)
- vlc_object_release((vlc_object_t*)p_input);
-
+ p_access = access_New( p_parent, NULL, psz_access, psz_demux, psz_path );
if( p_access == NULL )
{
msg_Err( p_parent, "no suitable access module for `%s'", psz_url );
return NULL;
s->p_input = p_access->p_input;
+ s->psz_access = strdup( p_access->psz_access );
s->psz_path = strdup( p_access->psz_location );
s->p_sys = p_sys = malloc( sizeof( *p_sys ) );
- if( !s->psz_path || !s->p_sys )
+ if( !s->psz_access || !s->psz_path || !s->p_sys )
{
stream_CommonDelete( s );
return NULL;
}
- /* Attach it now, needed for b_die */
- vlc_object_attach( s, p_access );
-
s->pf_read = NULL; /* Set up later */
s->pf_peek = NULL;
s->pf_control = AStreamControl;
if( p_sys->method == STREAM_METHOD_BLOCK )
{
- msg_Dbg( s, "Using AStream*Block" );
+ msg_Dbg( s, "Using block method for AStream*" );
s->pf_read = AStreamReadBlock;
s->pf_peek = AStreamPeekBlock;
assert( p_sys->method == STREAM_METHOD_STREAM );
- msg_Dbg( s, "Using AStream*Stream" );
+ msg_Dbg( s, "Using stream method for AStream*" );
s->pf_read = AStreamReadStream;
s->pf_peek = AStreamPeekStream;
int64_t i_first = 0;
int64_t i_start;
- msg_Dbg( s, "pre buffering" );
+ msg_Dbg( s, "starting pre-buffering" );
i_start = mdate();
for( ;; )
{
int64_t i_first = 0;
int64_t i_start;
- msg_Dbg( s, "pre buffering" );
+ msg_Dbg( s, "starting pre-buffering" );
i_start = mdate();
for( ;; )
{
{
stream_sys_t *p_sys = s->p_sys;
access_t *p_access = p_sys->p_access;
- input_thread_t *p_input = NULL;
+ input_thread_t *p_input = s->p_input;
int i_read_orig = i_read;
int i_total = 0;
- if( s->p_parent && s->p_parent->p_parent &&
- vlc_internals( s->p_parent->p_parent )->i_object_type == VLC_OBJECT_INPUT )
- p_input = (input_thread_t *)s->p_parent->p_parent;
-
if( !p_sys->i_list )
{
i_read = p_access->pf_read( p_access, p_read, i_read );
{
stream_sys_t *p_sys = s->p_sys;
access_t *p_access = p_sys->p_access;
- input_thread_t *p_input = NULL;
+ input_thread_t *p_input = s->p_input;
block_t *p_block;
bool b_eof;
int i_total = 0;
- if( s->p_parent && s->p_parent->p_parent &&
- vlc_internals( s->p_parent->p_parent )->i_object_type == VLC_OBJECT_INPUT )
- p_input = (input_thread_t *)s->p_parent->p_parent;
-
if( !p_sys->i_list )
{
p_block = p_access->pf_block( p_access );