[vlc-devel] [PATCH 4/9] demux: mkv: fix DTS of outgoing blocks

Steve Lhomme robux4 at ycbcr.xyz
Mon Jul 16 12:02:18 CEST 2018

On 2018-07-16 11:15, Denis Charmet wrote:
> Hi,
> On 2018-07-16 05:19, Filip Roséen wrote:
>> The previous implementation would set the VLC block's DTS to
>> VLC_TICK_INVALID for matroska-frames within a matroska block, which in
>> turn would confuse the decoder as it would then have to assume that
>> the block in question belonged to the most recently set PCR.
>> This works fine in cases where the PCR is updated often enough to
>> almost match the track's frames, but in cases where another track is
>> preventing the PCR from updating frequently enough (video track with
>> long blocks of many matroska-frames), the PCR would be too far in the
>> past to base the outgoing block's DTS on. As a result, the decoder
>> would think the outgoing blocks were coming in too early and employ
>> counter meassures to prevent unwanted drift.
>> By setting the DTS to the matroska-block's timestamp, we prevent the
>> above from happening, resulting in smoother playback.
> Setting DTS when not having them is a gamble. It might fix some 
> decoders and break some others. It's usually seen as acceptable for 
> keyframes to set DTS = PTS for the others. I don't have an example so 
> I won't fight it but beware :).
>> Included in this patch is a rename of the former i_pts parameter to
>> BlockDecode: "i_timecode" should make it more clear that we are
>> dealing with the block's timestamp, which might or might not be the
>> same as the outgoing frames' pts.
> <nitpicking> To be fair, everybody on the normalization comitee agree 
> that timecode is a poor choice and it will hopefully be changed to 
> something better. </nitpicking>

Actually it's been changed in the specs, now it's officially and 
correctly timestamps. So it should be i_timestamp, i_timecode would mean 
something from a Timecode track.

> Otherwise the whole set LGTM.
> Regards,
> -- 
> Denis Charmet - TypX
> Le mauvais esprit est un art de vivre
> _______________________________________________
> 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