X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fmux%2Fmpeg%2Fps.c;h=47f2a40b7c6f6afcaf1367b3e292aff9ef45d5c4;hb=HEAD;hp=a7e4ef5f7266d74875022f7e628e4452bb84a6de;hpb=52c18c4dec68158eedd655e0502820b7d7b6128f;p=vlc diff --git a/modules/mux/mpeg/ps.c b/modules/mux/mpeg/ps.c index a7e4ef5f72..47f2a40b7c 100644 --- a/modules/mux/mpeg/ps.c +++ b/modules/mux/mpeg/ps.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include "bits.h" @@ -67,9 +66,7 @@ vlc_module_begin () set_category( CAT_SOUT ) set_subcategory( SUBCAT_SOUT_MUX ) set_capability( "sout mux", 50 ) - add_shortcut( "ps" ) - add_shortcut( "mpeg1" ) - add_shortcut( "dvd" ) + add_shortcut( "ps", "mpeg1", "dvd" ) set_callbacks( Open, Close ) add_integer( SOUT_CFG_PREFIX "dts-delay", 200, NULL, DTS_TEXT, @@ -89,7 +86,6 @@ static int Mux ( sout_mux_t * ); /***************************************************************************** * Local prototypes *****************************************************************************/ -static int MuxGetStream ( sout_mux_t *, int *, mtime_t * ); static void MuxWritePackHeader ( sout_mux_t *, block_t **, mtime_t ); static void MuxWriteSystemHeader( sout_mux_t *, block_t **, mtime_t ); @@ -457,10 +453,10 @@ static int Mux( sout_mux_t *p_mux ) block_t *p_ps, *p_data; mtime_t i_dts; - int i_stream; /* Choose which stream to mux */ - if( MuxGetStream( p_mux, &i_stream, &i_dts ) ) + int i_stream = sout_MuxGetStream( p_mux, 1, &i_dts ); + if( i_stream < 0 ) { return VLC_SUCCESS; } @@ -799,43 +795,3 @@ static void MuxWritePSM( sout_mux_t *p_mux, block_t **p_buf, mtime_t i_dts ) block_ChainAppend( p_buf, p_hdr ); } - -/* - * Find stream to be muxed. - */ -static int MuxGetStream( sout_mux_t *p_mux, int *pi_stream, mtime_t *pi_dts ) -{ - mtime_t i_dts; - int i_stream, i; - - for( i = 0, i_dts = 0, i_stream = -1; i < p_mux->i_nb_inputs; i++ ) - { - sout_input_t *p_input = p_mux->pp_inputs[i]; - block_t *p_data; - - if( block_FifoCount( p_input->p_fifo ) <= 0 ) - { - if( p_input->p_fmt->i_cat == AUDIO_ES || - p_input->p_fmt->i_cat == VIDEO_ES ) - { - /* We need that audio+video fifo contain at least 1 packet */ - return VLC_EGENERIC; - } - - /* SPU */ - continue; - } - - p_data = block_FifoShow( p_input->p_fifo ); - if( i_stream == -1 || p_data->i_dts < i_dts ) - { - i_stream = i; - i_dts = p_data->i_dts; - } - } - - *pi_stream = i_stream; - *pi_dts = i_dts; - - return VLC_SUCCESS; -}