[vlc-commits] demux:mkv: parse the first Cluster when we look for the duration

Steve Lhomme git at videolan.org
Thu Feb 15 16:39:56 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Feb 15 14:50:30 2018 +0100| [ec0ae5b5ef8d09bea7882e90e858df163b23176a] | committer: Thomas Guillem

demux:mkv: parse the first Cluster when we look for the duration

Since we don't preload it by default anymore

(cherry picked from commit 56ceba435f4e8c87aabbaa62f4352c6aa7ef0e8a)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 modules/demux/mkv/matroska_segment.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index c97d283bab..cfd7e818f1 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -1044,7 +1044,12 @@ void matroska_segment_c::EnsureDuration()
         }
 
         if( MKV_IS_ID( el, KaxCluster ) )
+        {
             i_last_cluster_pos = el->GetElementPosition();
+            if ( i_last_cluster_pos == cluster->GetElementPosition() )
+                // make sure our first Cluster has a timestamp
+                ParseCluster( cluster, false, SCOPE_PARTIAL_DATA );
+        }
     }
 
     // find the last timecode in the Cluster



More information about the vlc-commits mailing list