[vlc-commits] input: fix es_out_id_t/vlc_es_id_t mismatch
Thomas Guillem
git at videolan.org
Fri Feb 28 20:45:58 CET 2020
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Feb 27 15:21:29 2020 +0100| [31be08d12e5bc7eb3d3d026c2dd5dbb36ddf809d] | committer: Thomas Guillem
input: fix es_out_id_t/vlc_es_id_t mismatch
Harmless for now since they both point on the same struct.
es_out_id_t will be used from public controls, and vlc_es_id_t from private
ones. Indeed, vlc_es_id_t need to be hold/release from the timeshift (and only
this API allow it). es_out_id_t don't have to be hold/release from demux
modules since they controls their lifespan.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=31be08d12e5bc7eb3d3d026c2dd5dbb36ddf809d
---
src/input/es_out.c | 6 ++++--
src/input/es_out.h | 6 +++---
src/input/input.c | 3 +--
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/input/es_out.c b/src/input/es_out.c
index ff9cdbcc82..bb24305b15 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -3390,7 +3390,8 @@ static int EsOutVaPrivControlLocked( es_out_t *out, int query, va_list args )
}
case ES_OUT_PRIV_SET_ES_DELAY:
{
- es_out_id_t *es = va_arg(args, es_out_id_t *);
+ vlc_es_id_t *es_id = va_arg( args, vlc_es_id_t * );
+ es_out_id_t *es = vlc_es_id_get_out( es_id );
const vlc_tick_t delay = va_arg(args, vlc_tick_t);
EsOutSetEsDelay(out, es, delay);
return VLC_SUCCESS;
@@ -3521,7 +3522,8 @@ static int EsOutVaPrivControlLocked( es_out_t *out, int query, va_list args )
case ES_OUT_PRIV_SET_VBI_PAGE:
case ES_OUT_PRIV_SET_VBI_TRANSPARENCY:
{
- es_out_id_t *es = va_arg( args, es_out_id_t * );
+ vlc_es_id_t *es_id = va_arg( args, vlc_es_id_t * );
+ es_out_id_t *es = vlc_es_id_get_out( es_id );
assert(es);
if( !es->p_dec || es->fmt.i_cat != SPU_ES
|| es->fmt.i_codec != VLC_CODEC_TELETEXT )
diff --git a/src/input/es_out.h b/src/input/es_out.h
index faa3ddfa2f..67b2a1e96a 100644
--- a/src/input/es_out.h
+++ b/src/input/es_out.h
@@ -44,7 +44,7 @@ enum es_out_query_private_e
ES_OUT_PRIV_GET_WAKE_UP, /* arg1=vlc_tick_t* res=cannot fail */
/* Select a list of ES */
- ES_OUT_PRIV_SET_ES_LIST, /* arg1= es_out_id_t *const* (null terminated array) */
+ ES_OUT_PRIV_SET_ES_LIST, /* arg1= vlc_es_id_t *const* (null terminated array) */
/* Disable autoselection of tracks from a given category */
ES_OUT_PRIV_SET_AUTOSELECT, /* arg1= int (es category),
@@ -65,7 +65,7 @@ enum es_out_query_private_e
ES_OUT_PRIV_GET_BUFFERING, /* arg1=bool* res=cannot fail */
/* Set delay for an ES identifier */
- ES_OUT_PRIV_SET_ES_DELAY, /* arg1=es_out_id_t *, res=cannot fail */
+ ES_OUT_PRIV_SET_ES_DELAY, /* arg1=vlc_es_id_t *, res=cannot fail */
/* Set delay for a ES category */
ES_OUT_PRIV_SET_DELAY, /* arg1=es_category_e, res=cannot fail */
@@ -176,7 +176,7 @@ static inline bool es_out_GetEmpty( es_out_t *p_out )
assert( !i_ret );
return b;
}
-static inline void es_out_SetEsDelay( es_out_t *p_out, es_out_id_t *es, vlc_tick_t i_delay )
+static inline void es_out_SetEsDelay( es_out_t *p_out, vlc_es_id_t *es, vlc_tick_t i_delay )
{
int i_ret = es_out_PrivControl( p_out, ES_OUT_PRIV_SET_ES_DELAY, es, i_delay );
assert( !i_ret );
diff --git a/src/input/input.c b/src/input/input.c
index 26b93ad8eb..94458a68ce 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2086,8 +2086,7 @@ static bool Control( input_thread_t *p_input,
break;
case INPUT_CONTROL_SET_ES_DELAY:
assert(param.es_delay.id);
- es_out_SetEsDelay(priv->p_es_out_display,
- vlc_es_id_get_out(param.es_delay.id),
+ es_out_SetEsDelay(priv->p_es_out_display, param.es_delay.id,
param.es_delay.delay);
break;
More information about the vlc-commits
mailing list