[vlc-devel] [PATCH 02/13] Replace es_out_sys_t* by void*
Romain Vimont
rom1v at videolabs.io
Tue Apr 24 11:18:20 CEST 2018
See #17078
---
include/vlc_es_out.h | 2 +-
modules/access/bluray.c | 22 ++++++++++++++--------
src/input/es_out.c | 15 +++++++++------
3 files changed, 24 insertions(+), 15 deletions(-)
diff --git a/include/vlc_es_out.h b/include/vlc_es_out.h
index fe53c2a3d3..1199461c2a 100644
--- a/include/vlc_es_out.h
+++ b/include/vlc_es_out.h
@@ -116,7 +116,7 @@ struct es_out_t
int (*pf_control)( es_out_t *, int i_query, va_list );
void (*pf_destroy)( es_out_t * );
- es_out_sys_t *p_sys;
+ void *p_sys;
};
VLC_USED
diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index 50ff17d395..4b7e0d497b 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -1001,7 +1001,8 @@ static int blurayEsPid(demux_sys_t *p_sys, int es_type, int i_es_idx)
static es_out_id_t *esOutAdd(es_out_t *p_out, const es_format_t *p_fmt)
{
- demux_t *p_demux = p_out->p_sys->p_demux;
+ es_out_sys_t *es_out_sys = p_out->p_sys;
+ demux_t *p_demux = es_out_sys->p_demux;
demux_sys_t *p_sys = p_demux->p_sys;
es_format_t fmt;
bool b_select = false;
@@ -1061,14 +1062,16 @@ static es_out_id_t *esOutAdd(es_out_t *p_out, const es_format_t *p_fmt)
static int esOutSend(es_out_t *p_out, es_out_id_t *p_es, block_t *p_block)
{
- demux_t *p_demux = p_out->p_sys->p_demux;
+ es_out_sys_t *es_out_sys = p_out->p_sys;
+ demux_t *p_demux = es_out_sys->p_demux;
return es_out_Send(p_demux->out, p_es, p_block);
}
static void esOutDel(es_out_t *p_out, es_out_id_t *p_es)
{
- demux_t *p_demux = p_out->p_sys->p_demux;
+ es_out_sys_t *es_out_sys = p_out->p_sys;
+ demux_t *p_demux = es_out_sys->p_demux;
demux_sys_t *p_sys = p_demux->p_sys;
int idx = findEsPairIndexByEs(p_sys, p_es);
@@ -1081,14 +1084,16 @@ static void esOutDel(es_out_t *p_out, es_out_id_t *p_es)
static int esOutControl(es_out_t *p_out, int i_query, va_list args)
{
- demux_t *p_demux = p_out->p_sys->p_demux;
+ es_out_sys_t *es_out_sys = p_out->p_sys;
+ demux_t *p_demux = es_out_sys->p_demux;
return es_out_vaControl(p_demux->out, i_query, args);
}
static void esOutDestroy(es_out_t *p_out)
{
- demux_t *p_demux = p_out->p_sys->p_demux;
+ es_out_sys_t *es_out_sys = p_out->p_sys;
+ demux_t *p_demux = es_out_sys->p_demux;
demux_sys_t *p_sys = p_demux->p_sys;
for (size_t i = 0; i < vlc_array_count(&p_sys->es); ++i)
@@ -1114,12 +1119,13 @@ static es_out_t *esOutNew(demux_t *p_demux)
p_out->pf_destroy = esOutDestroy;
p_out->pf_send = esOutSend;
- p_out->p_sys = malloc(sizeof(*p_out->p_sys));
- if (unlikely(p_out->p_sys == NULL)) {
+ es_out_sys_t *es_out_sys = malloc(sizeof(*es_out_sys));
+ if (unlikely(es_out_sys == NULL)) {
free(p_out);
return NULL;
}
- p_out->p_sys->p_demux = p_demux;
+ p_out->p_sys = es_out_sys;
+ es_out_sys->p_demux = p_demux;
return p_out;
}
diff --git a/src/input/es_out.c b/src/input/es_out.c
index db465feca8..4e471e6455 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -422,10 +422,11 @@ static es_out_id_t *EsOutGetFromID( es_out_t *out, int i_id )
return es_cat - i_id;
}
- for( int i = 0; i < out->p_sys->i_es; i++ )
+ es_out_sys_t *p_sys = out->p_sys;
+ for( int i = 0; i < p_sys->i_es; i++ )
{
- if( out->p_sys->es[i]->i_id == i_id )
- return out->p_sys->es[i];
+ if( p_sys->es[i]->i_id == i_id )
+ return p_sys->es[i];
}
return NULL;
}
@@ -826,7 +827,7 @@ static void EsOutFrameNext( es_out_t *out )
mtime_t i_duration;
input_DecoderFrameNext( p_es_video->p_dec, &i_duration );
- msg_Dbg( out->p_sys->p_input, "EsOutFrameNext consummed %d ms", (int)(i_duration/1000) );
+ msg_Dbg( p_sys->p_input, "EsOutFrameNext consummed %d ms", (int)(i_duration/1000) );
if( i_duration <= 0 )
i_duration = 40*1000;
@@ -992,7 +993,8 @@ static void EsOutESVarUpdate( es_out_t *out, es_out_id_t *es,
static bool EsOutIsProgramVisible( es_out_t *out, int i_group )
{
- return out->p_sys->i_group_id == 0 || out->p_sys->i_group_id == i_group;
+ es_out_sys_t *p_sys = out->p_sys;
+ return p_sys->i_group_id == 0 || p_sys->i_group_id == i_group;
}
/* EsOutProgramSelect:
@@ -3370,7 +3372,8 @@ static void EsDeleteInfo( es_out_t *out, es_out_id_t *es )
if( likely( psz_info_category = EsInfoCategoryName( es ) ) )
{
- input_Control( out->p_sys->p_input, INPUT_DEL_INFO,
+ es_out_sys_t *p_sys = out->p_sys;
+ input_Control( p_sys->p_input, INPUT_DEL_INFO,
psz_info_category, NULL );
free( psz_info_category );
--
2.17.0
More information about the vlc-devel
mailing list