{
sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
sout_stream_id_sys_t *p_es = malloc( sizeof(sout_stream_id_sys_t) );
+ if( unlikely(p_es == NULL) )
+ return NULL;
+
+ es_format_Copy( &p_es->fmt, p_fmt );
- p_es->fmt = *p_fmt;
p_es->id = NULL;
p_es->i_last = VLC_TS_INVALID;
p_es->b_error = false;
static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *p_es )
{
sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
- sout_stream_id_sys_t *id = p_es->id;
+
+ if( p_es->id != NULL )
+ sout_StreamIdDel( p_stream->p_next, p_es->id );
TAB_REMOVE( p_sys->i_es_num, p_sys->pp_es, p_es );
+ es_format_Clean( &p_es->fmt );
free( p_es );
-
- if ( id != NULL )
- p_stream->p_next->pf_del( p_stream->p_next, id );
}
static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *p_es,