[vlc-devel] [PATCH 1/3] ts: cache the low-delay option

Jean-Baptiste Kempf jb at videolan.org
Thu Dec 5 11:25:49 CET 2019


LGTM

On Thu, Dec 5, 2019, at 10:46, Thomas Guillem wrote:
> ---
>  modules/demux/mpeg/ts.c | 6 ++++--
>  modules/demux/mpeg/ts.h | 1 +
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
> index d66412b197f..dd7a87acc75 100644
> --- a/modules/demux/mpeg/ts.c
> +++ b/modules/demux/mpeg/ts.c
> @@ -502,6 +502,7 @@ static int Open( vlc_object_t *p_this )
>  
>      p_sys->b_canseek = false;
>      p_sys->b_canfastseek = false;
> +    p_sys->b_lowdelay = var_InheritBool( p_demux, "low-delay" );
>      p_sys->b_ignore_time_for_positions = var_InheritBool( p_demux, 
> "ts-seek-percent" );
>      p_sys->b_cc_check = var_InheritBool( p_demux, "ts-cc-check" );
>  
> @@ -1460,7 +1461,8 @@ static block_t * ConvertPESBlock( demux_t 
> *p_demux, ts_es_t *p_es,
>   
> ****************************************************************************/
>  static void SendDataChain( demux_t *p_demux, ts_es_t *p_es, block_t 
> *p_chain )
>  {
> -    bool b_lowdelay = var_InheritBool(p_demux, "low-delay");
> +    demux_sys_t *p_sys = p_demux->p_sys;
> +
>      while( p_chain )
>      {
>          block_t *p_block = p_chain;
> @@ -1470,7 +1472,7 @@ static void SendDataChain( demux_t *p_demux, 
> ts_es_t *p_es, block_t *p_chain )
>          /* clean up any private flag */
>          p_block->i_flags &= ~BLOCK_FLAG_PRIVATE_MASK;
>  
> -        if( b_lowdelay )
> +        if( p_sys->b_lowdelay )
>              p_block->i_flags |= BLOCK_FLAG_AU_END;
>  
>          ts_es_t *p_es_send = p_es;
> diff --git a/modules/demux/mpeg/ts.h b/modules/demux/mpeg/ts.h
> index 2ba3f207e9a..613a03ebcce 100644
> --- a/modules/demux/mpeg/ts.h
> +++ b/modules/demux/mpeg/ts.h
> @@ -56,6 +56,7 @@ struct demux_sys_t
>      stream_t   *stream;
>      bool        b_canseek;
>      bool        b_canfastseek;
> +    bool        b_lowdelay;
>      int         current_title;
>      int         current_seekpoint;
>      unsigned    updates;
> -- 
> 2.20.1
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

-- 
Jean-Baptiste Kempf -  President
+33 672 704 734


More information about the vlc-devel mailing list