vlc | branch: master | Francois Cartegnie <[email protected]> | Wed Apr 16 21:34:33 2014 +0200| [c4b10db33cf1431f55fceddec9284a56d18b7341] | committer: Francois Cartegnie
demux: ts: only SET_GROUP_PCR on groups with es (fix #6029) There was the missing ref clock assertion after SET_GROUP_PCR because that group had no active es. Unsure if that's the best way to find all es associated to a PMT/group/program Francois > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c4b10db33cf1431f55fceddec9284a56d18b7341 --- modules/demux/ts.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/modules/demux/ts.c b/modules/demux/ts.c index 7673e79..6decd2f 100644 --- a/modules/demux/ts.c +++ b/modules/demux/ts.c @@ -2167,16 +2167,34 @@ static void PCRHandle( demux_t *p_demux, ts_pid_t *pid, block_t *p_bk ) p_sys->i_current_pcr = AdjustPCRWrapAround( p_demux, i_pcr ); /* Search program and set the PCR */ - for( int i = 0; i < p_sys->i_pmt; i++ ) + int i_group = -1; + for( int i = 0; i < p_sys->i_pmt && i_group < 0 ; i++ ) + { + bool b_pmt_has_es = false; + for( int i_prg = 0; i_prg < p_sys->pmt[i]->psi->i_prg; i_prg++ ) + { if( pid->i_pid == p_sys->pmt[i]->psi->prg[i_prg]->i_pid_pcr ) { + /* We've found our target group */ p_sys->pmt[i]->psi->prg[i_prg]->i_pcr_value = i_pcr; - if (p_sys->b_trust_pcr) - es_out_Control( p_demux->out, ES_OUT_SET_GROUP_PCR, - (int)p_sys->pmt[i]->psi->prg[i_prg]->i_number, - (int64_t)(VLC_TS_0 + i_pcr * 100 / 9) ); + i_group = p_sys->pmt[i]->psi->prg[i_prg]->i_number; + for( int j = 0; j < 8192; j++ ) + { + const ts_pid_t *pid = &p_sys->pid[j]; + if( pid->b_valid && pid->p_owner == p_sys->pmt[i]->psi && pid->es ) + { + b_pmt_has_es = true; + break; + } + } } + } + + if ( p_sys->b_trust_pcr && i_group > 0 && b_pmt_has_es ) + es_out_Control( p_demux->out, ES_OUT_SET_GROUP_PCR, + i_group, VLC_TS_0 + i_pcr * 100 / 9 ); + } } static bool GatherData( demux_t *p_demux, ts_pid_t *pid, block_t *p_bk ) _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
