/* Module properties for stream filter */
module_t *p_module;
+ /* Real or virtual path (it can only be changed during stream_t opening) */
+ char *psz_path;
+
/* Stream source for stream filter */
stream_t *p_source;
vlc_iconv_close( s->p_text->conv );
free( s->p_text );
}
+ free( s->psz_path );
vlc_object_release( s );
}
if( !s )
return NULL;
+ s->psz_path = strdup( p_access->psz_path );
s->p_sys = p_sys = malloc( sizeof( *p_sys ) );
- if( !p_sys )
+ if( !s->psz_path || !s->p_sys )
{
stream_CommonDelete( s );
return NULL;
s = stream_CommonNew( p_obj );
if( s == NULL )
return NULL;
+ s->psz_path = strdup(""); /* N/A */
s->pf_read = DStreamRead;
s->pf_peek = DStreamPeek;
s->pf_control= DStreamControl;
s->pf_destroy= DStreamDelete;
s->p_sys = p_sys = malloc( sizeof( *p_sys) );
- if( s->p_sys == NULL )
+ if( !s->psz_path || !s->p_sys )
{
stream_CommonDelete( s );
return NULL;
return NULL;
/* */
+ s->psz_path = strdup( p_source->psz_path );
+ if( !s->psz_path )
+ {
+ stream_CommonDelete( s );
+ return NULL;
+ }
s->p_source = p_source;
/* */
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;