[vlc-devel] [PATCH 1/4] es_out: fix flapping PREROLL flag on non dated packets

Steve Lhomme robux4 at ycbcr.xyz
Thu Oct 1 12:35:19 CEST 2020

On 2020-10-01 12:10, Francois Cartegnie wrote:
> Le 01/10/2020 à 08:01, Steve Lhomme a écrit :
>> If i_date is interpolated, because the p_block has no PTS/DTS. It seems
>> fair to assume the p_block will also not have an i_length. So I'm not
>> sure what this value will lead to.
> We use previous, pcr or interpolated.
> If there's no previous, that's start of stream, the comparison will
> trigger preroll (just like before the patch), and we always need preroll
>   on start.

I am commenting this line
   es->i_roll_level = i_date + p_block->i_length;

Even in the patch code you sent a few lines before there is
   if( p_block->i_pts == VLC_TICK_INVALID )
     i_date = p_block->i_dts;

Both could be invalid. You added if( i_date == VLC_TICK_INVALID ) just 

So it's fair to say you can get there with a p_block that has no PTS nor 
DTS. And yet you assume the p_block->i_length can be used and it will 
never be invalid. That doesn't seem right.

More information about the vlc-devel mailing list