Commit 0a66b41b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

sout: access_out and SDP do not need a sout instance

Any object can do. So do not bother with p_sout.
parent f33e3e4b
......@@ -272,7 +272,6 @@ static char * es_print_url( const char *psz_fmt, vlc_fourcc_t i_fourcc, int i_co
static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_instance_t *p_sout = p_stream->p_sout;
sout_stream_id_t *id;
const char *psz_access;
......@@ -354,7 +353,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
psz_access, psz_mux, psz_dst );
/* *** find and open appropriate access module *** */
p_access = sout_AccessOutNew( p_sout, psz_access, psz_dst );
p_access = sout_AccessOutNew( p_stream, psz_access, psz_dst );
if( p_access == NULL )
{
msg_Err( p_stream, "no suitable sout access module for `%s/%s://%s'",
......@@ -369,7 +368,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
}
/* *** find and open appropriate mux module *** */
p_mux = sout_MuxNew( p_sout, psz_mux, p_access );
p_mux = sout_MuxNew( p_stream->p_sout, psz_mux, p_access );
if( p_mux == NULL )
{
msg_Err( p_stream, "no suitable sout mux module for `%s/%s://%s'",
......@@ -404,7 +403,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
}
if( !sout_AccessOutCanControlPace( p_access ) )
p_sout->i_out_pace_nocontrol++;
p_stream->p_sout->i_out_pace_nocontrol++;
return id;
}
......
......@@ -397,7 +397,6 @@ struct sout_stream_id_t
static int Open( vlc_object_t *p_this )
{
sout_stream_t *p_stream = (sout_stream_t*)p_this;
sout_instance_t *p_sout = p_stream->p_sout;
sout_stream_sys_t *p_sys = NULL;
config_chain_t *p_cfg = NULL;
char *psz;
......@@ -571,7 +570,7 @@ static int Open( vlc_object_t *p_this )
}
p_sys->p_grab = GrabberCreate( p_stream );
p_sys->p_mux = sout_MuxNew( p_sout, psz, p_sys->p_grab );
p_sys->p_mux = sout_MuxNew( p_stream->p_sout, psz, p_sys->p_grab );
free( psz );
if( p_sys->p_mux == NULL )
......@@ -1306,17 +1305,16 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
static int SapSetup( sout_stream_t *p_stream )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_instance_t *p_sout = p_stream->p_sout;
/* Remove the previous session */
if( p_sys->p_session != NULL)
{
sout_AnnounceUnRegister( p_sout, p_sys->p_session);
sout_AnnounceUnRegister( p_stream, p_sys->p_session);
p_sys->p_session = NULL;
}
if( p_sys->i_es > 0 && p_sys->psz_sdp && *p_sys->psz_sdp )
p_sys->p_session = sout_AnnounceRegisterSDP( p_sout,
p_sys->p_session = sout_AnnounceRegisterSDP( p_stream,
p_sys->psz_sdp,
p_sys->psz_destination );
......
......@@ -197,7 +197,7 @@ static void create_SDP(sout_stream_t *p_stream, sout_access_out_t *p_access)
{
msg_Dbg (p_stream, "Generated SDP:\n%s", psz_sdp);
p_sys->p_session =
sout_AnnounceRegisterSDP (p_stream->p_sout, psz_sdp, dhost);
sout_AnnounceRegisterSDP (p_stream, psz_sdp, dhost);
free( psz_sdp );
}
}
......@@ -321,7 +321,6 @@ static void checkAccessMux( sout_stream_t *p_stream, char *psz_access,
static int Open( vlc_object_t *p_this )
{
sout_stream_t *p_stream = (sout_stream_t*)p_this;
sout_instance_t *p_sout = p_stream->p_sout;
sout_stream_sys_t *p_sys;
char *psz_mux, *psz_access, *psz_url;
sout_access_out_t *p_access;
......@@ -375,7 +374,7 @@ static int Open( vlc_object_t *p_this )
checkAccessMux( p_stream, psz_access, psz_mux );
p_access = sout_AccessOutNew( p_sout, psz_access, psz_url );
p_access = sout_AccessOutNew( p_stream, psz_access, psz_url );
if( p_access == NULL )
{
msg_Err( p_stream, "no suitable sout access module for `%s/%s://%s'",
......@@ -383,7 +382,7 @@ static int Open( vlc_object_t *p_this )
goto end;
}
p_sys->p_mux = sout_MuxNew( p_sout, psz_mux, p_access );
p_sys->p_mux = sout_MuxNew( p_stream->p_sout, psz_mux, p_access );
if( !p_sys->p_mux )
{
const char *psz_mux_guess = getMuxFromAlias( psz_mux );
......@@ -391,7 +390,7 @@ static int Open( vlc_object_t *p_this )
{
msg_Dbg( p_stream, "Couldn't open mux `%s', trying `%s' instead",
psz_mux, psz_mux_guess );
p_sys->p_mux = sout_MuxNew( p_sout, psz_mux_guess, p_access );
p_sys->p_mux = sout_MuxNew( p_stream->p_sout, psz_mux_guess, p_access );
}
if( !p_sys->p_mux )
......@@ -408,7 +407,7 @@ static int Open( vlc_object_t *p_this )
create_SDP( p_stream, p_access );
if( !sout_AccessOutCanControlPace( p_access ) )
p_sout->i_out_pace_nocontrol++;
p_stream->p_sout->i_out_pace_nocontrol++;
p_stream->pf_add = Add;
p_stream->pf_del = Del;
......@@ -438,7 +437,7 @@ static void Close( vlc_object_t * p_this )
sout_access_out_t *p_access = p_sys->p_mux->p_access;
if( p_sys->p_session != NULL )
sout_AnnounceUnRegister( p_stream->p_sout, p_sys->p_session );
sout_AnnounceUnRegister( p_stream, p_sys->p_session );
sout_MuxDelete( p_sys->p_mux );
if( !sout_AccessOutCanControlPace( p_access ) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment