Commit c78a7a1c authored by François Cartegnie's avatar François Cartegnie 🤞

demux: ts: fix inconsistency on un/seekable UNKOWN_ES

parent 054dedf3
......@@ -2514,13 +2514,15 @@ void AddAndCreateES( demux_t *p_demux, ts_pid_t *pid, bool b_create_delayed )
if( pid && p_sys->es_creation == CREATE_ES )
{
DoCreateES( p_demux, pid->u.p_pes->p_es, NULL );
ts_pes_es_t *p_es = pid->u.p_pes->p_es;
DoCreateES( p_demux, p_es, NULL );
/* Update the default program == first created ES group */
if( p_sys->b_default_selection && p_sys->programs.i_size > 0)
if( p_sys->b_default_selection && p_sys->programs.i_size > 0 &&
(p_es->fmt.i_cat == VIDEO_ES || p_es->fmt.i_cat == AUDIO_ES) )
{
p_sys->b_default_selection = false;
const int i_first_program = pid->u.p_pes->p_es->p_program->i_number;
const int i_first_program = p_es->p_program->i_number;
if( p_sys->programs.p_elems[0] != i_first_program )
p_sys->programs.p_elems[0] = i_first_program;
msg_Dbg( p_demux, "Default program is %d", i_first_program );
......
......@@ -1582,8 +1582,6 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
(p_dr->p_data[0] << 8) | p_dr->p_data[1] );
}
const bool b_create_es = (p_pes->p_es->fmt.i_cat != UNKNOWN_ES);
/* Now check and merge */
if( b_pid_inuse ) /* We need to compare to the existing pes/es */
{
......@@ -1644,8 +1642,7 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
}
}
/* Nothing to do, pes is now just set */
if( b_create_es )
AddAndCreateES( p_demux, pespid, false );
AddAndCreateES( p_demux, pespid, false );
}
/* Set CAM descrambling */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment