]> git.sesse.net Git - vlc/commitdiff
Matroska seems to stupidly store dts instead of pts for real video codec.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 28 Mar 2009 16:49:52 +0000 (17:49 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 28 Mar 2009 16:50:55 +0000 (17:50 +0100)
modules/demux/mkv/matroska_segment.cpp
modules/demux/mkv/matroska_segment_parse.cpp
modules/demux/mkv/mkv.cpp
modules/demux/mkv/mkv.hpp

index 6002db20c1aabf84483cbd410615da3460dfcb2a..984e078fd9a578a946e287087143892a535fbfa2 100644 (file)
@@ -664,6 +664,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
                     memcpy( tracks[i_track]->fmt.p_extra, &p_bih[1], tracks[i_track]->fmt.i_extra );
                 }
             }
+            p_tk->b_dts_only = true;
         }
         else if( !strcmp( tracks[i_track]->psz_codec, "V_MPEG1" ) ||
                  !strcmp( tracks[i_track]->psz_codec, "V_MPEG2" ) )
@@ -760,6 +761,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
                     memcpy( p_fmt->p_extra, &p_tk->p_extra_data[26], p_fmt->i_extra );
                 }
             }
+            p_tk->b_dts_only = true;
         }
         else if( !strncmp( tracks[i_track]->psz_codec, "V_DIRAC", 7 ) )
         {
index 8933f34ace1e157a3b3be258d730eb40606cba6f..fb1b23376ab0f2d603c8686ebeb68e3da177713a 100644 (file)
@@ -184,6 +184,7 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
     tk->i_extra_data = 0;
     tk->p_extra_data = NULL;
     tk->psz_codec = NULL;
+    tk->b_dts_only = false;
     tk->i_default_duration = 0;
     tk->f_timecodescale = 1.0;
 
index 2e6ae6531a7111294a8d751101e3cefdf920cda7..371386ff596220a32da7c2331bbdd3617236d915 100644 (file)
@@ -578,9 +578,8 @@ static void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simp
         }
         else
         {
-            if( !strcmp( tk->psz_codec, "V_MS/VFW/FOURCC" ) )
+            if( tk->b_dts_only )
             {
-                // in VFW we have no idea about B frames
                 p_block->i_pts = 0;
                 p_block->i_dts = i_pts;
             }
index 35db8af87093284edf8f3e9d4d96cf14bd06e466..c01e5fff96066343d37a609bbd70b347a860905f 100644 (file)
@@ -194,6 +194,7 @@ typedef struct
     uint8_t      *p_extra_data;
 
     char         *psz_codec;
+    bool         b_dts_only;
 
     uint64_t     i_default_duration;
     float        f_timecodescale;