Commit 1fe24f39 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: ps: delay creation from system header

parent a32c5ee7
......@@ -469,9 +469,11 @@ static int Demux( demux_t *p_demux )
{
ps_track_t *tk = &p_sys->tk[i];
if( tk->b_seen && !tk->es && tk->fmt.i_cat != UNKNOWN_ES )
if( !tk->b_configured && tk->fmt.i_cat != UNKNOWN_ES )
{
tk->es = es_out_Add( p_demux->out, &tk->fmt );
if( tk->b_seen )
tk->es = es_out_Add( p_demux->out, &tk->fmt );
/* else create when seeing packet */
tk->b_configured = true;
}
}
......@@ -546,6 +548,12 @@ static int Demux( demux_t *p_demux )
}
}
/* Late creation from system header */
if( !tk->b_seen && tk->b_configured && !tk->es && tk->fmt.i_cat != UNKNOWN_ES )
tk->es = es_out_Add( p_demux->out, &tk->fmt );
tk->b_seen = true;
/* The popular VCD/SVCD subtitling WinSubMux does not
* renumber the SCRs when merging subtitles into the PES */
if( tk->b_seen && !p_sys->b_bad_scr &&
......
......@@ -483,11 +483,8 @@ static inline int ps_pkt_parse_system( block_t *p_pkt, ps_psm_t *p_psm,
continue;
int i_tk = PS_ID_TO_TK( i_id );
if( !tk[i_tk].b_configured &&
!ps_track_fill( &tk[i_tk], p_psm, i_id, NULL, false ) )
{
tk[i_tk].b_configured = true;
}
if( !tk[i_tk].b_configured )
ps_track_fill( &tk[i_tk], p_psm, i_id, NULL, false );
}
return VLC_SUCCESS;
}
......
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