[vlc-devel] [PATCH] demux: avformat: do not take account of invalid streams for PCR updating

Jean-Baptiste Kempf jb at videolan.org
Wed Mar 22 09:13:31 CET 2017


ping for review

On Mon, 20 Mar 2017, at 16:56, Zhao Zhili wrote:
> ---
>  modules/demux/avformat/demux.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/modules/demux/avformat/demux.c
> b/modules/demux/avformat/demux.c
> index 4824215..48ba7f8 100644
> --- a/modules/demux/avformat/demux.c
> +++ b/modules/demux/avformat/demux.c
> @@ -834,17 +834,22 @@ static int Demux( demux_t *p_demux )
>      msg_Dbg( p_demux, "tk[%d] dts=%"PRId64" pts=%"PRId64,
>               pkt.stream_index, p_frame->i_dts, p_frame->i_pts );
>  #endif
> -    if( p_frame->i_dts > VLC_TS_INVALID )
> +    if( p_frame->i_dts > VLC_TS_INVALID && p_sys->tk[pkt.stream_index]
> != NULL )
>          p_sys->tk_pcr[pkt.stream_index] = p_frame->i_dts;
>  
>      int64_t i_ts_max = INT64_MIN;
>      for( int i = 0; i < p_sys->i_tk; i++ )
> -        i_ts_max = __MAX( i_ts_max, p_sys->tk_pcr[i] );
> +    {
> +        if( p_sys->tk[i] != NULL )
> +            i_ts_max = __MAX( i_ts_max, p_sys->tk_pcr[i] );
> +    }
>  
>      int64_t i_ts_min = INT64_MAX;
>      for( int i = 0; i < p_sys->i_tk; i++ )
>      {
> -        if( p_sys->tk_pcr[i] > VLC_TS_INVALID && p_sys->tk_pcr[i] + 10 *
> CLOCK_FREQ >= i_ts_max )
> +        if( p_sys->tk[i] != NULL &&
> +                p_sys->tk_pcr[i] > VLC_TS_INVALID &&
> +                p_sys->tk_pcr[i] + 10 * CLOCK_FREQ >= i_ts_max )
>              i_ts_min = __MIN( i_ts_min, p_sys->tk_pcr[i] );
>      }
>      if( i_ts_min >= p_sys->i_pcr )
> -- 
> 2.10.1 (Apple Git-78)
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> Email had 1 attachment:
> + 0001-demux-avformat-do-not-take-account-of-invalid-stream.patch
>   2k (text/plain)


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


More information about the vlc-devel mailing list