Commit d4c955a6 authored by Filip Roséen's avatar Filip Roséen Committed by Jean-Baptiste Kempf

input/es_out: properly update/delete information on ES changes

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 9a2a96c7
...@@ -1025,7 +1025,11 @@ static void EsOutProgramSelect( es_out_t *out, es_out_pgrm_t *p_pgrm ) ...@@ -1025,7 +1025,11 @@ static void EsOutProgramSelect( es_out_t *out, es_out_pgrm_t *p_pgrm )
for( i = 0; i < p_sys->i_es; i++ ) for( i = 0; i < p_sys->i_es; i++ )
{ {
if( p_sys->es[i]->p_pgrm == p_sys->p_pgrm ) if( p_sys->es[i]->p_pgrm == p_sys->p_pgrm )
{
EsOutESVarUpdate( out, p_sys->es[i], false ); EsOutESVarUpdate( out, p_sys->es[i], false );
EsOutUpdateInfo( out, p_sys->es[i], &p_sys->es[i]->fmt, NULL );
}
EsOutSelect( out, p_sys->es[i], false ); EsOutSelect( out, p_sys->es[i], false );
} }
...@@ -1523,13 +1527,6 @@ static es_out_id_t *EsOutAdd( es_out_t *out, const es_format_t *fmt ) ...@@ -1523,13 +1527,6 @@ static es_out_id_t *EsOutAdd( es_out_t *out, const es_format_t *fmt )
es->pb_cc_present[i] = false; es->pb_cc_present[i] = false;
es->p_master = NULL; es->p_master = NULL;
if( es->p_pgrm == p_sys->p_pgrm )
EsOutESVarUpdate( out, es, false );
/* Select it if needed */
EsOutSelect( out, es, false );
TAB_APPEND( out->p_sys->i_es, out->p_sys->es, es ); TAB_APPEND( out->p_sys->i_es, out->p_sys->es, es );
p_sys->i_id++; /* always incremented */ p_sys->i_id++; /* always incremented */
switch( es->fmt.i_cat ) switch( es->fmt.i_cat )
...@@ -1545,7 +1542,11 @@ static es_out_id_t *EsOutAdd( es_out_t *out, const es_format_t *fmt ) ...@@ -1545,7 +1542,11 @@ static es_out_id_t *EsOutAdd( es_out_t *out, const es_format_t *fmt )
break; break;
} }
if( es->p_pgrm == p_sys->p_pgrm )
EsOutESVarUpdate( out, es, false );
EsOutUpdateInfo( out, es, &es->fmt, NULL ); EsOutUpdateInfo( out, es, &es->fmt, NULL );
EsOutSelect( out, es, false );
if( es->b_scrambled ) if( es->b_scrambled )
EsOutProgramUpdateScrambled( out, es->p_pgrm ); EsOutProgramUpdateScrambled( out, es->p_pgrm );
...@@ -2089,6 +2090,8 @@ static void EsOutDel( es_out_t *out, es_out_id_t *es ) ...@@ -2089,6 +2090,8 @@ static void EsOutDel( es_out_t *out, es_out_id_t *es )
if( es->p_pgrm == p_sys->p_pgrm ) if( es->p_pgrm == p_sys->p_pgrm )
EsOutESVarUpdate( out, es, true ); EsOutESVarUpdate( out, es, true );
EsDeleteInfo( out, es );
TAB_REMOVE( p_sys->i_es, p_sys->es, es ); TAB_REMOVE( p_sys->i_es, p_sys->es, es );
/* Update program */ /* Update program */
...@@ -2893,10 +2896,16 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t * ...@@ -2893,10 +2896,16 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *
} }
/* Create category */ /* Create category */
char psz_cat[128]; char* psz_cat = EsInfoCategoryName( es );
snprintf( psz_cat, sizeof(psz_cat),_("Stream %d"), es->i_meta_id );
info_category_t *p_cat = info_category_New( psz_cat ); if( unlikely( !psz_cat ) )
if( !p_cat ) return;
info_category_t* p_cat = info_category_New( psz_cat );
free( psz_cat );
if( unlikely( !p_cat ) )
return; return;
/* Add information */ /* Add information */
......
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