stream_t *s = stream_CommonNew( p_this );
stream_sys_t *p_sys;
- if( !s ) return NULL;
+ if( !s )
+ return NULL;
+ s->psz_path = strdup( "" ); /* N/A */
s->p_sys = p_sys = malloc( sizeof( stream_sys_t ) );
+ if( !s->psz_path || !s->p_sys )
+ {
+ stream_CommonDelete( s );
+ return NULL;
+ }
p_sys->i_pos = 0;
p_sys->i_size = i_size;
p_sys->p_buffer = p_buffer;
s->pf_control = Control;
s->pf_destroy = Delete;
- s->i_char_width = 1;
- s->b_little_endian = false;
vlc_object_attach( s, p_this );
+ /* Get a weak link to the parent input */
+ /* FIXME: The usage of vlc_object_find has to be removed. */
+ s->p_input = (input_thread_t *)vlc_object_find( p_this, VLC_OBJECT_INPUT, FIND_PARENT );
+ if(s->p_input)
+ vlc_object_release((vlc_object_t*)s->p_input);
+
return s;
}
if( !s->p_sys->i_preserve_memory ) free( s->p_sys->p_buffer );
free( s->p_sys );
vlc_object_detach( s );
- vlc_object_release( s );
+ stream_CommonDelete( s );
}
/****************************************************************************
p_sys->i_pos = i_64;
break;
- case STREAM_GET_MTU:
case STREAM_GET_CONTENT_TYPE:
return VLC_EGENERIC;