[vlc-devel] [PATCH] demux/ogg: remove always false condition

Steve Lhomme robux4 at ycbcr.xyz
Thu Oct 8 14:39:47 CEST 2020


On 2020-10-08 14:33, Marvin Scholz wrote:
> Stream re-use could never happen, as p_stream->p_es is always NULL
> here, as implied by the earlier check:
> 
>     if ( p_stream->p_es == NULL && !p_stream->b_finished )

I think the title and explanation is misleading. It's true that 
p_stream->p_es here is always false. So the whole if() block should go 
away, not just this line. But that's not what you are doing, you are 
actually discarding the (false) value, so that stream re-use works.

> ---
>   modules/demux/ogg.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
> index 90edf1cb7e0..cedaccca068 100644
> --- a/modules/demux/ogg.c
> +++ b/modules/demux/ogg.c
> @@ -2141,7 +2141,7 @@ static void Ogg_CreateES( demux_t *p_demux, bool stable_id )
>               if( p_old_stream &&
>                   p_old_stream->fmt.i_cat == p_stream->fmt.i_cat &&
>                   p_old_stream->fmt.i_codec == p_stream->fmt.i_codec &&
> -                p_old_stream->p_es != NULL && p_stream->p_es != NULL )
> +                p_old_stream->p_es != NULL )
>               {
>                   msg_Dbg( p_demux, "will reuse old stream to avoid glitch" );
>   
> -- 
> 2.24.3 (Apple Git-128)
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> 


More information about the vlc-devel mailing list