vlc | branch: master | Steve Lhomme <[email protected]> | Mon Jan 18 14:33:00 
2021 +0100| [8cb6d352bea72e966d424300a95bfee2f38df422] | committer: Steve Lhomme

demux: mkv: fix PCR not starting in some cases

By default the index contains cluster positions with an unknown timestamp. In
some cases this unknown timestamp may end up being the only one we know (yet)
for some tracks. It's not a valid timestamp and should not overwrite valid
"last DTS" we found on other tracks when finding the PCR.

In the end we always end up never sending the PCR which ends up not starting
playback, which ends up not feeding more DTS, which ends up never getting any
PCR.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8cb6d352bea72e966d424300a95bfee2f38df422
---

 modules/demux/mkv/matroska_segment.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mkv/matroska_segment.cpp 
b/modules/demux/mkv/matroska_segment.cpp
index b022761ef3..c4abebb5d4 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -866,7 +866,8 @@ bool matroska_segment_c::Seek( demux_t &demuxer, vlc_tick_t 
i_absolute_mk_date,
             trackit->second->i_skip_until_fpos = it->second.fpos;
         else
             trackit->second->i_skip_until_fpos = 
std::numeric_limits<uint64_t>::max();
-        trackit->second->i_last_dts        = it->second.pts + i_mk_time_offset;
+        if (it->second.pts != -1)
+            trackit->second->i_last_dts        = it->second.pts + 
i_mk_time_offset;
 
         msg_Dbg( &sys.demuxer, "seek: preroll{ track: %u, pts: %" PRId64 ", 
fpos: %" PRIu64 " skip: %" PRIu64 "} ",
           it->first, it->second.pts, it->second.fpos, 
trackit->second->i_skip_until_fpos );

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to