vlc | branch: master | Francois Cartegnie <fcvlc...@free.fr> | Wed May 27 20:54:21 2020 +0200| [1ca0fadca7b74521f3e248bdc8bb99bf80cd6125] | committer: Francois Cartegnie
mux: ts: fix rate shaping backward PCR bug 16y old bug with spu or es add.. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1ca0fadca7b74521f3e248bdc8bb99bf80cd6125 --- modules/mux/mpeg/ts.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c index b1ebe0712f..d52289a325 100644 --- a/modules/mux/mpeg/ts.c +++ b/modules/mux/mpeg/ts.c @@ -1732,19 +1732,16 @@ static void TSSchedule( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts, vlc_tick_t i_max_diff = i_new_dts - p_ts->i_dts; vlc_tick_t i_cut_dts = p_ts->i_dts; - p_ts = BufferChainPeek( p_chain_ts ); - i++; - i_new_dts = i_pcr_dts + i_pcr_length * i / i_packet_count; - while ( p_ts != NULL && i_new_dts - p_ts->i_dts >= i_max_diff ) + while( (p_ts = BufferChainPeek( p_chain_ts )) ) { + i_new_dts = i_pcr_dts + i_pcr_length * i++ / i_packet_count; + if( p_ts->i_dts >= i_pcr_dts && + i_new_dts - p_ts->i_dts >= i_max_diff ) + break; p_ts = BufferChainGet( p_chain_ts ); + BufferChainAppend( &new_chain, p_ts ); i_max_diff = i_new_dts - p_ts->i_dts; i_cut_dts = p_ts->i_dts; - BufferChainAppend( &new_chain, p_ts ); - - p_ts = BufferChainPeek( p_chain_ts ); - i++; - i_new_dts = i_pcr_dts + i_pcr_length * i / i_packet_count; } msg_Dbg( p_mux, "adjusting rate at %"PRId64"/%"PRId64" (%d/%d)", i_cut_dts - i_pcr_dts, i_pcr_length, new_chain.i_depth, _______________________________________________ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits