[vlc-devel] [RFC-PATCH 05/12] core: added EsOutDecodersSetPreroll to es_out.c
Filip Roséen
filip at videolabs.io
Wed May 11 18:56:50 CEST 2016
This function is used to propagate the preroll-end-timestamp "down" to
each of the decoders associated with an es-out. This patch includes
introduction of such usage within the block that handles
ES_OUT_SET_NEXT_DISPLAY_TIME.
---
src/input/es_out.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/src/input/es_out.c b/src/input/es_out.c
index 6cfc112..c91a726 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -192,6 +192,7 @@ static void EsOutDecodersChangePause( es_out_t *out, bool b_paused, mtime_t i_da
static void EsOutProgramChangePause( es_out_t *out, bool b_paused, mtime_t i_date );
static void EsOutProgramsChangeRate( es_out_t *out );
static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced );
+static void EsOutDecodersSetPreroll( es_out_t *out, mtime_t i_date );
static char *LanguageGetName( const char *psz_code );
static char *LanguageGetCode( const char *psz_lang );
@@ -2455,6 +2456,8 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
if( i_date <= VLC_TS_INVALID )
return VLC_EGENERIC;
+ EsOutDecodersSetPreroll( out, i_date );
+
p_sys->i_preroll_end = i_date;
return VLC_SUCCESS;
@@ -3097,3 +3100,18 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *
/* */
input_Control( p_input, INPUT_REPLACE_INFOS, p_cat );
}
+
+static void EsOutDecodersSetPreroll( es_out_t* out, mtime_t i_date )
+{
+ es_out_sys_t * p_sys = out->p_sys;
+
+ for( int i = 0; i < p_sys->i_es; ++i )
+ {
+ es_out_id_t * p_es = p_sys->es[i];
+
+ if( p_es->p_dec )
+ {
+ input_DecoderSetPrerollEnd( p_es->p_dec, i_date );
+ }
+ }
+}
--
2.8.2
More information about the vlc-devel
mailing list