[vlc-devel] [PATCH] Avoid audio blocks with invalid pts and dts

Laurent Aimar fenrir at elivagar.org
Sat Jan 14 23:17:58 CET 2012


On Sat, Jan 14, 2012 at 11:07:45PM +0100, Denis Charmet wrote:
> This will avoid the blocks to be wrongly flaged as preroll data
> after seek.
> Fix #5165.
> ---
>  modules/demux/mkv/mkv.cpp |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
> index ebbcafa..2c1087e 100644
> --- a/modules/demux/mkv/mkv.cpp
> +++ b/modules/demux/mkv/mkv.cpp
> @@ -469,6 +469,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
>  {
>      demux_sys_t        *p_sys = p_demux->p_sys;
>      matroska_segment_c *p_segment = p_sys->p_current_segment->CurrentSegment();
> +    mtime_t i_dts = i_pts;
>  
>      if( !p_segment ) return;
>  
> @@ -582,7 +583,8 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
>          // correct timestamping when B frames are used
>          if( tk->fmt.i_cat != VIDEO_ES )
>          {
> -            p_block->i_dts = p_block->i_pts = i_pts;
> +            p_block->i_dts = i_dts + i;
> +            p_block->i_pts = i_pts;
 It's not correct, dts has a precise meaning.

IMHO, I think that you are workarounding another bug, but I have no clue
for the moment about what it could be.

Regards,

-- 
fenrir



More information about the vlc-devel mailing list