Skip to content

Commit

Permalink
es_out: unselect the main es before selecting a new one
Browse files Browse the repository at this point in the history
This avoids having more than one decoder per es and maybe more than one
aout/vout at the same time.

Fixes #19206
  • Loading branch information
tguillem committed Jan 23, 2018
1 parent 90cb142 commit 5ff52a4
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions src/input/es_out.c
Original file line number Diff line number Diff line change
Expand Up @@ -1864,10 +1864,19 @@ static void EsOutSelect( es_out_t *out, es_out_id_t *es, bool b_force )
return;
}

bool b_auto_unselect = p_esprops && p_sys->i_mode == ES_OUT_MODE_AUTO &&
p_esprops->e_policy == ES_OUT_ES_POLICY_EXCLUSIVE &&
p_esprops->p_main_es && p_esprops->p_main_es != es;

if( p_sys->i_mode == ES_OUT_MODE_ALL || b_force )
{
if( !EsIsSelected( es ) )
{
if( b_auto_unselect )
EsUnselect( out, p_esprops->p_main_es, false );

EsSelect( out, es );
}
}
else if( p_sys->i_mode == ES_OUT_MODE_PARTIAL )
{
Expand Down Expand Up @@ -1968,23 +1977,17 @@ static void EsOutSelect( es_out_t *out, es_out_id_t *es, bool b_force )
}

if( wanted_es == es && !EsIsSelected( es ) )
EsSelect( out, es );
}

/* FIXME TODO handle priority here */
if( p_esprops && EsIsSelected( es ) )
{
if( p_sys->i_mode == ES_OUT_MODE_AUTO )
{
if( p_esprops->e_policy == ES_OUT_ES_POLICY_EXCLUSIVE &&
p_esprops->p_main_es &&
p_esprops->p_main_es != es )
{
if( b_auto_unselect )
EsUnselect( out, p_esprops->p_main_es, false );
}
p_esprops->p_main_es = es;

EsSelect( out, es );
}
}

/* FIXME TODO handle priority here */
if( p_esprops && p_sys->i_mode == ES_OUT_MODE_AUTO && EsIsSelected( es ) )
p_esprops->p_main_es = es;
}

static void EsOutCreateCCChannels( es_out_t *out, vlc_fourcc_t codec, uint64_t i_bitmap,
Expand Down

0 comments on commit 5ff52a4

Please sign in to comment.