[vlc-commits] es_out: remove the i_id variable
Thomas Guillem
git at videolan.org
Mon Sep 3 17:05:53 CEST 2018
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Aug 30 16:41:39 2018 +0200| [01e43dea9926290e6bfb55a4ed8c5e43302535f9] | committer: Thomas Guillem
es_out: remove the i_id variable
Duplicate usage with fmt.i_id
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=01e43dea9926290e6bfb55a4ed8c5e43302535f9
---
src/input/es_out.c | 40 +++++++++++++++++++---------------------
1 file changed, 19 insertions(+), 21 deletions(-)
diff --git a/src/input/es_out.c b/src/input/es_out.c
index 462ad23423..305008c190 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -79,7 +79,6 @@ typedef struct
struct es_out_id_t
{
/* ES ID */
- int i_id;
es_out_pgrm_t *p_pgrm;
/* */
@@ -425,7 +424,7 @@ static es_out_id_t *EsOutGetFromID( es_out_t *out, int i_id )
}
foreach_es_then_es_slaves(es)
- if (es->i_id == i_id)
+ if (es->fmt.i_id == i_id)
return es;
return NULL;
}
@@ -973,7 +972,7 @@ static void EsOutSendEsEventGeneric( es_out_t *out, int i_id,
static void EsOutSendEsEvent( es_out_t *out, es_out_id_t *es,
bool b_delete )
{
- EsOutSendEsEventGeneric( out, es->i_id, &es->fmt, es->psz_language, b_delete );
+ EsOutSendEsEventGeneric( out, es->fmt.i_id, &es->fmt, es->psz_language, b_delete );
}
static bool EsOutIsProgramVisible( es_out_t *out, int i_group )
@@ -1545,7 +1544,6 @@ static es_out_id_t *EsOutAddSlaveLocked( es_out_t *out, const es_format_t *fmt,
if( !es->fmt.i_original_fourcc )
es->fmt.i_original_fourcc = es->fmt.i_codec;
- es->i_id = es->fmt.i_id;
es->i_meta_id = p_sys->i_id++; /* always incremented */
es->b_scrambled = false;
es->b_forced = false;
@@ -1716,7 +1714,7 @@ static void EsOutSelectEs( es_out_t *out, es_out_id_t *es )
if( EsIsSelected( es ) )
{
- msg_Warn( p_input, "ES 0x%x is already selected", es->i_id );
+ msg_Warn( p_input, "ES 0x%x is already selected", es->fmt.i_id );
return;
}
@@ -1745,7 +1743,7 @@ static void EsOutSelectEs( es_out_t *out, es_out_id_t *es )
if( !var_GetBool( p_input, b_sout ? "sout-video" : "video" ) )
{
msg_Dbg( p_input, "video is disabled, not selecting ES 0x%x",
- es->i_id );
+ es->fmt.i_id );
return;
}
}
@@ -1754,7 +1752,7 @@ static void EsOutSelectEs( es_out_t *out, es_out_id_t *es )
if( !var_GetBool( p_input, b_sout ? "sout-audio" : "audio" ) )
{
msg_Dbg( p_input, "audio is disabled, not selecting ES 0x%x",
- es->i_id );
+ es->fmt.i_id );
return;
}
}
@@ -1763,7 +1761,7 @@ static void EsOutSelectEs( es_out_t *out, es_out_id_t *es )
if( !var_GetBool( p_input, b_sout ? "sout-spu" : "spu" ) )
{
msg_Dbg( p_input, "spu is disabled, not selecting ES 0x%x",
- es->i_id );
+ es->fmt.i_id );
return;
}
}
@@ -1788,7 +1786,7 @@ static void EsDeleteCCChannels( es_out_t *out, es_out_id_t *parent )
return;
es_out_id_t *spu_es = EsOutGetSelectedCat( out, SPU_ES );
- const int i_spu_id = spu_es ? spu_es->i_id : -1;
+ const int i_spu_id = spu_es ? spu_es->fmt.i_id : -1;
uint64_t i_bitmap = parent->cc.i_bitmap;
for( int i = 0; i_bitmap > 0; i++, i_bitmap >>= 1 )
@@ -1796,7 +1794,7 @@ static void EsDeleteCCChannels( es_out_t *out, es_out_id_t *parent )
if( (i_bitmap & 1) == 0 || !parent->cc.pp_es[i] )
continue;
- if( i_spu_id == parent->cc.pp_es[i]->i_id )
+ if( i_spu_id == parent->cc.pp_es[i]->fmt.i_id )
{
/* Force unselection of the CC */
input_SendEventEsUnselect( p_input, &parent->cc.pp_es[i]->fmt );
@@ -1815,7 +1813,7 @@ static void EsOutUnselectEs( es_out_t *out, es_out_id_t *es, bool b_update )
if( !EsIsSelected( es ) )
{
- msg_Warn( p_input, "ES 0x%x is already unselected", es->i_id );
+ msg_Warn( p_input, "ES 0x%x is already unselected", es->fmt.i_id );
return;
}
@@ -1907,7 +1905,7 @@ static void EsOutSelect( es_out_t *out, es_out_id_t *es, bool b_force )
/* user designated by ID ES have higher prio than everything */
if ( p_esprops->i_id >= 0 )
{
- if( es->i_id == p_esprops->i_id )
+ if( es->fmt.i_id == p_esprops->i_id )
wanted_es = es;
}
/* then per pos */
@@ -1945,7 +1943,7 @@ static void EsOutSelect( es_out_t *out, es_out_id_t *es, bool b_force )
if( current_es_idx < 0 ) /* No es is currently selected by lang pref */
{
/* If demux has specified a track */
- if( p_esprops->i_demux_id >= 0 && es->i_id == p_esprops->i_demux_id )
+ if( p_esprops->i_demux_id >= 0 && es->fmt.i_id == p_esprops->i_demux_id )
{
wanted_es = es;
}
@@ -1963,7 +1961,7 @@ static void EsOutSelect( es_out_t *out, es_out_id_t *es, bool b_force )
}
/* If there is no user preference, select the default subtitle
* or adapt by ES priority */
- else if( p_esprops->i_demux_id >= 0 && es->i_id == p_esprops->i_demux_id )
+ else if( p_esprops->i_demux_id >= 0 && es->fmt.i_id == p_esprops->i_demux_id )
{
wanted_es = es;
}
@@ -2006,7 +2004,7 @@ static void EsOutCreateCCChannels( es_out_t *out, vlc_fourcc_t codec, uint64_t i
if( (i_bitmap & 1) == 0 || (i_existingbitmap & 1) )
continue;
- msg_Dbg( p_input, "Adding CC track %d for es[%d]", 1+i, parent->i_id );
+ msg_Dbg( p_input, "Adding CC track %d for es[%d]", 1+i, parent->fmt.i_id );
es_format_Init( &fmt, SPU_ES, codec );
fmt.subs.cc.i_channel = i;
@@ -2440,7 +2438,7 @@ static int EsOutVaControlLocked( es_out_t *out, int i_query, va_list args )
if (EsIsSelected(es))
{
EsOutDestroyDecoder(out, es);
- *++selected_es = es->i_id;
+ *++selected_es = es->fmt.i_id;
}
else
*++selected_es = -1;
@@ -2489,13 +2487,13 @@ static int EsOutVaControlLocked( es_out_t *out, int i_query, va_list args )
else
{
/*if( es->fmt.i_cat == VIDEO_ES )
- p_sys->i_default_video_id = es->i_id;
+ p_sys->i_default_video_id = es->fmt.i_id;
else
if( es->fmt.i_cat == AUDIO_ES )
- p_sys->i_default_audio_id = es->i_id;
+ p_sys->i_default_audio_id = es->fmt.i_id;
else*/
if( es->fmt.i_cat == SPU_ES )
- p_sys->sub.i_demux_id = es->i_id;
+ p_sys->sub.i_demux_id = es->fmt.i_id;
}
return VLC_SUCCESS;
}
@@ -3179,9 +3177,9 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *
return;
/* Add information */
- if( es->i_meta_id != es->i_id )
+ if( es->i_meta_id != es->fmt.i_id )
info_category_AddInfo( p_cat, _("Original ID"),
- "%d", es->i_id );
+ "%d", es->fmt.i_id );
const vlc_fourcc_t i_codec_fourcc = ( p_fmt_es->i_original_fourcc )?
p_fmt_es->i_original_fourcc : p_fmt_es->i_codec;
More information about the vlc-commits
mailing list