* duplicate.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: duplicate.c,v 1.1 2003/04/13 20:00:21 fenrir Exp $
+ * $Id: duplicate.c,v 1.2 2003/05/19 11:38:05 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
static sout_stream_id_t *Add ( sout_stream_t *, sout_format_t * );
static int Del ( sout_stream_t *, sout_stream_id_t * );
-static int Send( sout_stream_t *, sout_stream_id_t *, sout_buffer_t* );
+static int Send( sout_stream_t *, sout_stream_id_t *,
+ sout_buffer_t* );
/*****************************************************************************
* Module descriptor
msg_Dbg( p_stream, " * adding `%s'", p_cfg->psz_value );
s = sout_stream_new( p_stream->p_sout, p_cfg->psz_value );
- TAB_APPEND( p_sys->i_nb_streams, p_sys->pp_streams, s );
+ if( s )
+ {
+ TAB_APPEND( p_sys->i_nb_streams, p_sys->pp_streams, s );
+ }
}
}
int i;
- msg_Dbg( p_stream, "closing a duplication" );
+ msg_Dbg( p_stream, "closing a duplication");
for( i = 0; i < p_sys->i_nb_streams; i++ )
{
sout_stream_delete( p_sys->pp_streams[i] );
free( p_sys );
}
-
-
-static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_fmt )
+static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_stream_id_t *id;
void *id_new;
/* XXX not the same sout_stream_id_t definition ... */
- id_new = (void*)p_sys->pp_streams[i_stream]->pf_add( p_sys->pp_streams[i_stream], p_fmt );
- TAB_APPEND( id->i_nb_ids, id->pp_ids, id_new );
+ id_new = (void*)p_sys->pp_streams[i_stream]->pf_add(
+ p_sys->pp_streams[i_stream], p_fmt );
+ if( id_new )
+ {
+ TAB_APPEND( id->i_nb_ids, id->pp_ids, id_new );
+ }
}
if( id->i_nb_ids <= 0 )
return id;
}
-static int Del ( sout_stream_t *p_stream, sout_stream_id_t *id )
+static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
int i_stream;
return VLC_SUCCESS;
}
-static int Send ( sout_stream_t *p_stream, sout_stream_id_t *id, sout_buffer_t *p_buffer )
+static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
+ sout_buffer_t *p_buffer )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
int i_stream;
return VLC_SUCCESS;
}
-
* stream_output.c : stream output module
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: stream_output.c,v 1.28 2003/04/29 22:38:56 fenrir Exp $
+ * $Id: stream_output.c,v 1.29 2003/05/19 11:38:05 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Laurent Aimar <fenrir@via.ecp.fr>
p_stream->p_sout = p_sout;
p_stream->p_sys = NULL;
- p_stream->psz_next = sout_cfg_parser( &p_stream->psz_name, &p_stream->p_cfg, psz_chain);
+ p_stream->psz_next =
+ sout_cfg_parser( &p_stream->psz_name, &p_stream->p_cfg, psz_chain);
+
msg_Dbg( p_sout, "stream=`%s'", p_stream->psz_name );
p_stream->p_module =
if( !p_stream->p_module )
{
- /* FIXME */
- vlc_object_destroy( p_stream );
+ sout_stream_delete( p_stream );
return NULL;
}
sout_cfg_t *p_cfg;
msg_Dbg( p_stream, "destroying chain... (name=%s)", p_stream->psz_name );
- module_Unneed( p_stream, p_stream->p_module );
+ if( p_stream->p_module ) module_Unneed( p_stream, p_stream->p_module );
FREE( p_stream->psz_name );
FREE( p_stream->psz_next );