[vlc-devel] [PATCH 4/9] demux: mkv: fix DTS of outgoing blocks
typx at dinauz.org
Mon Jul 16 11:15:10 CEST 2018
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>
Otherwise the whole set LGTM.
Denis Charmet - TypX
Le mauvais esprit est un art de vivre
More information about the vlc-devel