From: RĂ©mi Denis-Courmont Date: Sat, 21 Feb 2015 10:23:42 +0000 (+0200) Subject: mux: remove return value from sout_mux_t.pf_delstream X-Git-Url: https://git.sesse.net/?p=vlc;a=commitdiff_plain;h=ec0c77b99503476e499bc5260317df9c2332087b mux: remove return value from sout_mux_t.pf_delstream This is always VLC_SUCCESS anyway. --- diff --git a/include/vlc_sout.h b/include/vlc_sout.h index efc1e2ffbf..bba94462e6 100644 --- a/include/vlc_sout.h +++ b/include/vlc_sout.h @@ -115,7 +115,7 @@ struct sout_mux_t sout_access_out_t *p_access; int (*pf_addstream)( sout_mux_t *, sout_input_t * ); - int (*pf_delstream)( sout_mux_t *, sout_input_t * ); + void (*pf_delstream)( sout_mux_t *, sout_input_t * ); int (*pf_mux) ( sout_mux_t * ); int (*pf_control) ( sout_mux_t *, int, va_list ); diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c index 2974a6de3d..0dd24cd841 100644 --- a/modules/demux/avformat/mux.c +++ b/modules/demux/avformat/mux.c @@ -68,7 +68,7 @@ struct sout_mux_sys_t *****************************************************************************/ static int Control ( sout_mux_t *, int, va_list ); static int AddStream( sout_mux_t *, sout_input_t * ); -static int DelStream( sout_mux_t *, sout_input_t * ); +static void DelStream( sout_mux_t *, sout_input_t * ); static int Mux ( sout_mux_t * ); static int IOWrite( void *opaque, uint8_t *buf, int buf_size ); @@ -300,11 +300,10 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) /***************************************************************************** * DelStream *****************************************************************************/ -static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) +static void DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) { msg_Dbg( p_mux, "removing input" ); free( p_input->p_sys ); - return VLC_SUCCESS; } static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input ) diff --git a/modules/mux/asf.c b/modules/mux/asf.c index c8d98ebbc4..df21588fb3 100644 --- a/modules/mux/asf.c +++ b/modules/mux/asf.c @@ -105,7 +105,7 @@ static const char *const ppsz_sout_options[] = { static int Control ( sout_mux_t *, int, va_list ); static int AddStream( sout_mux_t *, sout_input_t * ); -static int DelStream( sout_mux_t *, sout_input_t * ); +static void DelStream( sout_mux_t *, sout_input_t * ); static int Mux ( sout_mux_t * ); typedef struct @@ -634,7 +634,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) /***************************************************************************** * DelStream: *****************************************************************************/ -static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) +static void DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) { /* if bitrate ain't defined in commandline, reduce it when tracks are deleted */ @@ -664,7 +664,6 @@ static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) vlc_array_remove( p_sys->p_tracks, vlc_array_index_of_item( p_sys->p_tracks, (void *)tk ) ); p_sys->b_write_header = true; } - return VLC_SUCCESS; } /***************************************************************************** diff --git a/modules/mux/avi.c b/modules/mux/avi.c index e76507baea..1cdea1dd2b 100644 --- a/modules/mux/avi.c +++ b/modules/mux/avi.c @@ -84,7 +84,7 @@ vlc_module_end () *****************************************************************************/ static int Control( sout_mux_t *, int, va_list ); static int AddStream( sout_mux_t *, sout_input_t * ); -static int DelStream( sout_mux_t *, sout_input_t * ); +static void DelStream( sout_mux_t *, sout_input_t * ); static int Mux ( sout_mux_t * ); typedef struct avi_stream_s @@ -456,12 +456,11 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) return( VLC_SUCCESS ); } -static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) +static void DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) { msg_Dbg( p_mux, "removing input" ); free( p_input->p_sys ); - return 0; } static int Mux ( sout_mux_t *p_mux ) diff --git a/modules/mux/dummy.c b/modules/mux/dummy.c index 64ad84a757..7ec7dccd1a 100644 --- a/modules/mux/dummy.c +++ b/modules/mux/dummy.c @@ -55,7 +55,7 @@ vlc_module_end () *****************************************************************************/ static int Control( sout_mux_t *, int, va_list ); static int AddStream( sout_mux_t *, sout_input_t * ); -static int DelStream( sout_mux_t *, sout_input_t * ); +static void DelStream( sout_mux_t *, sout_input_t * ); static int Mux ( sout_mux_t * ); struct sout_mux_sys_t @@ -132,11 +132,10 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) return VLC_SUCCESS; } -static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) +static void DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) { VLC_UNUSED(p_input); msg_Dbg( p_mux, "removing input" ); - return VLC_SUCCESS; } static int Mux( sout_mux_t *p_mux ) diff --git a/modules/mux/mp4.c b/modules/mux/mp4.c index 04818f15c3..10fd8caba3 100644 --- a/modules/mux/mp4.c +++ b/modules/mux/mp4.c @@ -95,7 +95,7 @@ static const char *const ppsz_sout_options[] = { static int Control(sout_mux_t *, int, va_list); static int AddStream(sout_mux_t *, sout_input_t *); -static int DelStream(sout_mux_t *, sout_input_t *); +static void DelStream(sout_mux_t *, sout_input_t *); static int Mux (sout_mux_t *); static int MuxFrag (sout_mux_t *); @@ -527,11 +527,10 @@ static int AddStream(sout_mux_t *p_mux, sout_input_t *p_input) /***************************************************************************** * DelStream: *****************************************************************************/ -static int DelStream(sout_mux_t *p_mux, sout_input_t *p_input) +static void DelStream(sout_mux_t *p_mux, sout_input_t *p_input) { VLC_UNUSED(p_input); msg_Dbg(p_mux, "removing input"); - return VLC_SUCCESS; } /***************************************************************************** diff --git a/modules/mux/mpeg/ps.c b/modules/mux/mpeg/ps.c index 6dd65c9309..41d040078f 100644 --- a/modules/mux/mpeg/ps.c +++ b/modules/mux/mpeg/ps.c @@ -80,7 +80,7 @@ vlc_module_end () *****************************************************************************/ static int Control ( sout_mux_t *, int, va_list ); static int AddStream( sout_mux_t *, sout_input_t * ); -static int DelStream( sout_mux_t *, sout_input_t * ); +static void DelStream( sout_mux_t *, sout_input_t * ); static int Mux ( sout_mux_t * ); /***************************************************************************** @@ -383,7 +383,7 @@ error: /***************************************************************************** * DelStream: *****************************************************************************/ -static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) +static void DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) { sout_mux_sys_t *p_sys = p_mux->p_sys; ps_stream_t *p_stream =(ps_stream_t*)p_input->p_sys; @@ -437,7 +437,6 @@ static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) p_sys->i_psm_version++; free( p_stream ); - return VLC_SUCCESS; } /***************************************************************************** diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c index 0e8db716dd..3cb7a038e1 100644 --- a/modules/mux/mpeg/ts.c +++ b/modules/mux/mpeg/ts.c @@ -456,7 +456,7 @@ static int intcompare( const void *pa, const void *pb ) *****************************************************************************/ static int Control ( sout_mux_t *, int, va_list ); static int AddStream( sout_mux_t *, sout_input_t * ); -static int DelStream( sout_mux_t *, sout_input_t * ); +static void DelStream( sout_mux_t *, sout_input_t * ); static int Mux ( sout_mux_t * ); static block_t *FixPES( sout_mux_t *p_mux, block_fifo_t *p_fifo ); @@ -1127,7 +1127,7 @@ oom: /***************************************************************************** * DelStream: called before a stream deletion *****************************************************************************/ -static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) +static void DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) { sout_mux_sys_t *p_sys = p_mux->p_sys; sout_input_sys_t *p_stream = (sout_input_sys_t*)p_input->p_sys; @@ -1200,8 +1200,6 @@ static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) /* We only change PMT version (PAT isn't changed) */ p_sys->i_pmt_version_number++; p_sys->i_pmt_version_number %= 32; - - return VLC_SUCCESS; } static void SetHeader( sout_buffer_chain_t *c, diff --git a/modules/mux/mpjpeg.c b/modules/mux/mpjpeg.c index b803f206f5..ee02485875 100644 --- a/modules/mux/mpjpeg.c +++ b/modules/mux/mpjpeg.c @@ -57,7 +57,7 @@ vlc_module_end () *****************************************************************************/ static int Control ( sout_mux_t *, int, va_list ); static int AddStream( sout_mux_t *, sout_input_t * ); -static int DelStream( sout_mux_t *, sout_input_t * ); +static void DelStream( sout_mux_t *, sout_input_t * ); static int Mux ( sout_mux_t * ); /* This pseudo-random sequence is unlikely to ever happen */ @@ -136,11 +136,10 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) return VLC_SUCCESS; } -static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) +static void DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) { VLC_UNUSED(p_input); msg_Dbg( p_mux, "removing input" ); - return VLC_SUCCESS; } static int Mux( sout_mux_t *p_mux ) diff --git a/modules/mux/ogg.c b/modules/mux/ogg.c index 9b661bf3dd..b848cc509c 100644 --- a/modules/mux/ogg.c +++ b/modules/mux/ogg.c @@ -75,7 +75,7 @@ vlc_module_end () *****************************************************************************/ static int Control ( sout_mux_t *, int, va_list ); static int AddStream( sout_mux_t *, sout_input_t * ); -static int DelStream( sout_mux_t *, sout_input_t * ); +static void DelStream( sout_mux_t *, sout_input_t * ); static int Mux ( sout_mux_t * ); static int MuxBlock ( sout_mux_t *, sout_input_t * ); @@ -555,7 +555,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) /***************************************************************************** * DelStream: Delete an elementary stream from the muxed stream *****************************************************************************/ -static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) +static void DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) { sout_mux_sys_t *p_sys = p_mux->p_sys; ogg_stream_t *p_stream = (ogg_stream_t*)p_input->p_sys; diff --git a/modules/mux/wav.c b/modules/mux/wav.c index 981ac0544b..b9e3482723 100644 --- a/modules/mux/wav.c +++ b/modules/mux/wav.c @@ -56,7 +56,7 @@ vlc_module_end () *****************************************************************************/ static int Control ( sout_mux_t *, int, va_list ); static int AddStream( sout_mux_t *, sout_input_t * ); -static int DelStream( sout_mux_t *, sout_input_t * ); +static void DelStream( sout_mux_t *, sout_input_t * ); static int Mux ( sout_mux_t * ); #define MAX_CHANNELS 6 @@ -255,7 +255,7 @@ static block_t *GetHeader( sout_mux_t *p_mux ) return p_block; } -static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) +static void DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) { VLC_UNUSED(p_input); msg_Dbg( p_mux, "removing input" ); @@ -265,8 +265,6 @@ static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) { sout_AccessOutWrite( p_mux->p_access, GetHeader( p_mux ) ); } - - return VLC_SUCCESS; } static int Mux( sout_mux_t *p_mux ) diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c index fbc9f34b53..bfdda159df 100644 --- a/src/stream_output/stream_output.c +++ b/src/stream_output/stream_output.c @@ -490,10 +490,7 @@ void sout_MuxDeleteStream( sout_mux_t *p_mux, sout_input_t *p_input ) TAB_FIND( p_mux->i_nb_inputs, p_mux->pp_inputs, p_input, i_index ); if( i_index >= 0 ) { - if( p_mux->pf_delstream( p_mux, p_input ) < 0 ) - { - msg_Err( p_mux, "cannot delete this stream from mux" ); - } + p_mux->pf_delstream( p_mux, p_input ); /* remove the entry */ TAB_REMOVE( p_mux->i_nb_inputs, p_mux->pp_inputs, p_input );