X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fmux%2Fwav.c;h=ed522b684ea6caa84b4dd31e5357980ac23c474d;hb=ab1e2b524cb535d8c2ef1a7914f359d679d83136;hp=1d472409b1f7dce62a4e22bde250a71bece776c4;hpb=81c5ac29fa2e80426c1b1dfcc941a1aabe8bc808;p=vlc diff --git a/modules/mux/wav.c b/modules/mux/wav.c index 1d472409b1..ed522b684e 100644 --- a/modules/mux/wav.c +++ b/modules/mux/wav.c @@ -25,7 +25,12 @@ * Preamble *****************************************************************************/ -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include #include #include #include @@ -38,7 +43,7 @@ static int Open ( vlc_object_t * ); static void Close ( vlc_object_t * ); vlc_module_begin(); - set_description( _("WAV muxer") ); + set_description( N_("WAV muxer") ); set_capability( "sout mux", 5 ); set_category( CAT_SOUT ); set_subcategory( SUBCAT_SOUT_MUX ); @@ -58,9 +63,9 @@ static int Mux ( sout_mux_t * ); struct sout_mux_sys_t { - vlc_bool_t b_used; - vlc_bool_t b_header; - vlc_bool_t b_ext; + bool b_used; + bool b_header; + bool b_ext; uint32_t i_data; @@ -70,7 +75,7 @@ struct sout_mux_sys_t uint32_t waveheader2[2]; uint32_t i_channel_mask; - vlc_bool_t b_chan_reorder; /* do we need channel reordering */ + bool b_chan_reorder; /* do we need channel reordering */ int pi_chan_table[AOUT_CHAN_MAX]; }; @@ -105,8 +110,8 @@ static int Open( vlc_object_t *p_this ) p_mux->pf_mux = Mux; p_mux->p_sys = p_sys = malloc( sizeof( sout_mux_sys_t ) ); - p_sys->b_used = VLC_FALSE; - p_sys->b_header = VLC_TRUE; + p_sys->b_used = false; + p_sys->b_header = true; p_sys->i_data = 0; p_sys->b_chan_reorder = 0; @@ -126,29 +131,30 @@ static void Close( vlc_object_t * p_this ) static int Control( sout_mux_t *p_mux, int i_query, va_list args ) { - vlc_bool_t *pb_bool; + VLC_UNUSED(p_mux); + bool *pb_bool; char **ppsz; - switch( i_query ) - { - case MUX_CAN_ADD_STREAM_WHILE_MUXING: - pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * ); - *pb_bool = VLC_FALSE; - return VLC_SUCCESS; + switch( i_query ) + { + case MUX_CAN_ADD_STREAM_WHILE_MUXING: + pb_bool = (bool*)va_arg( args, bool * ); + *pb_bool = false; + return VLC_SUCCESS; - case MUX_GET_ADD_STREAM_WAIT: - pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t * ); - *pb_bool = VLC_TRUE; - return VLC_SUCCESS; + case MUX_GET_ADD_STREAM_WAIT: + pb_bool = (bool*)va_arg( args, bool * ); + *pb_bool = true; + return VLC_SUCCESS; - case MUX_GET_MIME: - ppsz = (char**)va_arg( args, char ** ); - *ppsz = strdup( "audio/wav" ); - return VLC_SUCCESS; + case MUX_GET_MIME: + ppsz = (char**)va_arg( args, char ** ); + *ppsz = strdup( "audio/wav" ); + return VLC_SUCCESS; default: return VLC_EGENERIC; - } + } } static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) { @@ -156,7 +162,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) sout_mux_sys_t *p_sys = p_mux->p_sys; WAVEFORMATEX *p_waveformat = &p_sys->waveformat.Format; int i_bytes_per_sample, i_format; - vlc_bool_t b_ext; + bool b_ext; if( p_input->p_fmt->i_cat != AUDIO_ES ) { @@ -178,7 +184,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) if( p_input->p_fmt->audio.i_physical_channels ) { unsigned int i; - + for( i = 0; i < sizeof(pi_channels_in)/sizeof(uint32_t); i++ ) { if( p_input->p_fmt->audio.i_physical_channels & pi_channels_src[i]) @@ -232,7 +238,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) p_sys->waveformat.SubFormat.Data1 = i_format; - p_sys->b_used = VLC_TRUE; + p_sys->b_used = true; return VLC_SUCCESS; } @@ -259,10 +265,11 @@ static block_t *GetHeader( sout_mux_t *p_mux ) static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input ) { + VLC_UNUSED(p_input); msg_Dbg( p_mux, "removing input" ); msg_Dbg( p_mux, "writing header data" ); - if( !sout_AccessOutSeek( p_mux->p_access, 0 ) ) + if( sout_AccessOutSeek( p_mux->p_access, 0 ) == VLC_SUCCESS ) { sout_AccessOutWrite( p_mux->p_access, GetHeader( p_mux ) ); } @@ -282,10 +289,10 @@ static int Mux( sout_mux_t *p_mux ) msg_Dbg( p_mux, "writing header data" ); sout_AccessOutWrite( p_mux->p_access, GetHeader( p_mux ) ); } - p_sys->b_header = VLC_FALSE; + p_sys->b_header = false; p_input = p_mux->pp_inputs[0]; - while( p_input->p_fifo->i_depth > 0 ) + while( block_FifoCount( p_input->p_fifo ) > 0 ) { block_t *p_block = block_FifoGet( p_input->p_fifo ); p_sys->i_data += p_block->i_buffer;