[vlc-commits] Regression fix for non-SPU tracks in MKV containers.

Ago Allikmaa git at videolan.org
Thu Nov 21 22:54:25 CET 2013


vlc | branch: master | Ago Allikmaa <maxorator at gmail.com> | Thu Nov 21 21:43:02 2013 +0000| [050333c7257e846e4cc2642663f901823a4c4746] | committer: Denis Charmet

Regression fix for non-SPU tracks in MKV containers.

Fixes track duration not being set for non-SPU tracks in MKV containers.

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

 modules/demux/mkv/matroska_segment_parse.cpp |    2 ++
 modules/demux/mkv/mkv.cpp                    |   11 ++++++-----
 modules/demux/mkv/mkv.hpp                    |    1 +
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index 8845823..360614d 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -222,6 +222,7 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
     tk->psz_codec              = NULL;
     tk->b_dts_only             = false;
     tk->i_default_duration     = 0;
+    tk->b_no_duration          = false;
     tk->f_timecodescale        = 1.0;
 
     tk->b_inited               = false;
@@ -1748,6 +1749,7 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
     else if( !strcmp( p_tk->psz_codec, "S_VOBSUB" ) )
     {
         p_tk->fmt.i_codec = VLC_CODEC_SPU;
+        p_tk->b_no_duration = true;
         if( p_tk->i_extra_data )
         {
             char *psz_start;
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index 42f3334..edf6a6f 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -602,11 +602,6 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
                 VLC_TS_INVALID;
             continue;
          }
-         case VLC_CODEC_SPU:
-            if( strcmp( tk->psz_codec, "S_VOBSUB" ) )
-                p_block->i_length = i_duration * tk-> f_timecodescale *
-                    (double) p_segment->i_timescale / 1000.0;
-            break;
          case VLC_CODEC_OPUS:
             if( i_duration > 0 )
             {
@@ -673,6 +668,12 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
 #if 0
 msg_Dbg( p_demux, "block i_dts: %"PRId64" / i_pts: %"PRId64, p_block->i_dts, p_block->i_pts);
 #endif
+        if( !tk->b_no_duration )
+        {
+            p_block->i_length = i_duration * tk-> f_timecodescale *
+                (double) p_segment->i_timescale / 1000.0;
+        }
+
         /* FIXME remove when VLC_TS_INVALID work is done */
         if( i == 0 || p_block->i_dts > VLC_TS_INVALID )
             p_block->i_dts += VLC_TS_0;
diff --git a/modules/demux/mkv/mkv.hpp b/modules/demux/mkv/mkv.hpp
index a883a46..0638914 100644
--- a/modules/demux/mkv/mkv.hpp
+++ b/modules/demux/mkv/mkv.hpp
@@ -201,6 +201,7 @@ struct mkv_track_t
     bool         b_dts_only;
     bool         b_pts_only;
 
+    bool         b_no_duration;
     uint64_t     i_default_duration;
     float        f_timecodescale;
     mtime_t      i_last_dts;



More information about the vlc-commits mailing list