[vlc-commits] mkv: an edition with no duration is OK if there's some chapter codec

Steve Lhomme git at videolan.org
Wed Mar 16 13:55:28 CET 2016


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Wed Mar 16 13:43:31 2016 +0100| [3b89b214984480739e5bc5971d0feaac1e60dd95] | committer: Jean-Baptiste Kempf

mkv: an edition with no duration is OK if there's some chapter codec

The chapter codec will likely request a jump to another Segment/Edition

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

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

diff --git a/modules/demux/mkv/virtual_segment.cpp b/modules/demux/mkv/virtual_segment.cpp
index aa11361..e10b2ee 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -274,9 +274,19 @@ virtual_segment_c::virtual_segment_c( matroska_segment_c & main_segment, std::ve
         /* Create a virtual edition from opened */
         virtual_edition_c * p_vedition = new virtual_edition_c( main_segment.stored_editions[i], main_segment, p_opened_segments );
 
+        bool b_has_translate = false;
+        for (size_t i=0; i < p_vedition->vchapters.size(); i++)
+        {
+            if ( p_vedition->vchapters[i]->segment.translations.size() != 0 )
+            {
+                b_has_translate = true;
+                break;
+            }
+        }
         /* Ordered empty edition can happen when all chapters are
          * on an other segment which couldn't be found... ignore it */
-        if(p_vedition->b_ordered && p_vedition->i_duration == 0)
+        /* OK if it has chapters and the translate codec in Matroska */
+        if(p_vedition->b_ordered && p_vedition->i_duration == 0 && !b_has_translate)
         {
 
             msg_Warn( &main_segment.sys.demuxer,



More information about the vlc-commits mailing list