[vlc-commits] demux/mkv: use infinite chapter as last resort

Filip Roséen git at videolan.org
Wed Oct 26 16:30:07 CEST 2016


vlc | branch: master | Filip Roséen <filip at atch.se> | Sat Oct 22 04:54:12 2016 +0200| [8d587e5c7213bd526dc1a4bc78b7b90c2507943c] | committer: Thomas Guillem

demux/mkv: use infinite chapter as last resort

This fixes issues where you try to seek in an mkv that does not have a
duration (ie. where the last chapter just goes on and on), and it is
especially important for mkvs that only contains one chapter (that
goes on forever).

Prior to this patch these would not play at all.

Signed-off-by: Steve Lhomme <robux4 at videolabs.io>
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 modules/demux/mkv/virtual_segment.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/modules/demux/mkv/virtual_segment.cpp b/modules/demux/mkv/virtual_segment.cpp
index b069ce8..a48c1b3 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -408,6 +408,17 @@ virtual_chapter_c* virtual_edition_c::getChapterbyTimecode( int64_t time )
             return vchapters[i]->getSubChapterbyTimecode( time );
     }
 
+    if( vchapters.size() )
+    {
+        virtual_chapter_c* last_chapter = vchapters.back();
+
+        if( last_chapter->i_mk_virtual_start_time <= time &&
+            last_chapter->i_mk_virtual_stop_time < 0 )
+        {
+            return last_chapter;
+        }
+    }
+
     return NULL;
 }
 



More information about the vlc-commits mailing list