[vlc-devel] commit: Matroska seems to stupidly store dts instead of pts for real video codec. (Laurent Aimar )
git version control
git at videolan.org
Sat Mar 28 17:51:15 CET 2009
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Mar 28 17:49:52 2009 +0100| [7cdc4e6d534952594a73c5792b409a2d96a39c38] | committer: Laurent Aimar
Matroska seems to stupidly store dts instead of pts for real video codec.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7cdc4e6d534952594a73c5792b409a2d96a39c38
---
modules/demux/mkv/matroska_segment.cpp | 2 ++
modules/demux/mkv/matroska_segment_parse.cpp | 1 +
modules/demux/mkv/mkv.cpp | 3 +--
modules/demux/mkv/mkv.hpp | 1 +
4 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index 6002db2..984e078 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -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 ) )
{
diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index 8933f34..fb1b233 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -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;
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index 2e6ae65..371386f 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -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;
}
diff --git a/modules/demux/mkv/mkv.hpp b/modules/demux/mkv/mkv.hpp
index 35db8af..c01e5ff 100644
--- a/modules/demux/mkv/mkv.hpp
+++ b/modules/demux/mkv/mkv.hpp
@@ -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;
More information about the vlc-devel
mailing list