[vlc-commits] commit: Fixed/improved support for video timestamp in mkv. (Laurent Aimar )
git at videolan.org
git at videolan.org
Fri May 21 10:49:34 CEST 2010
vlc/vlc-1.1 | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu May 20 22:52:46 2010 +0200| [255de00caf72fb7dcae1056f8555c5d662db8fd7] | committer: Jean-Baptiste Kempf
Fixed/improved support for video timestamp in mkv.
(cherry picked from commit 9adcbb2f05007beae7e8faf33b28ac921f5aa592)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=255de00caf72fb7dcae1056f8555c5d662db8fd7
---
modules/demux/mkv/matroska_segment.cpp | 2 ++
modules/demux/mkv/mkv.cpp | 6 +++++-
modules/demux/mkv/mkv.hpp | 1 +
3 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index 2f51b40..37e8f10 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -829,6 +829,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
tracks[i_track]->fmt.i_extra = tracks[i_track]->i_extra_data;
tracks[i_track]->fmt.p_extra = xmalloc( tracks[i_track]->i_extra_data );
memcpy( tracks[i_track]->fmt.p_extra,tracks[i_track]->p_extra_data, tracks[i_track]->i_extra_data );
+ tracks[i_track]->b_pts_only = true;
}
else if( !strncmp( tracks[i_track]->psz_codec, "V_REAL/RV", 9 ) )
{
@@ -859,6 +860,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
else if( !strncmp( tracks[i_track]->psz_codec, "V_VP8", 5 ) )
{
tracks[i_track]->fmt.i_codec = VLC_CODEC_VP8;
+ tracks[i_track]->b_pts_only = true;
}
else if( !strncmp( tracks[i_track]->psz_codec, "V_MPEG4", 7 ) )
{
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index d766d4f..9ee443e 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -589,6 +589,11 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
p_block->i_pts = VLC_TS_INVALID;
p_block->i_dts = i_pts;
}
+ else if( tk->b_pts_only )
+ {
+ p_block->i_pts = i_pts;
+ p_block->i_dts = i_pts;
+ }
else
{
p_block->i_pts = i_pts;
@@ -596,7 +601,6 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
p_block->i_dts = p_block->i_pts;
else
p_block->i_dts = min( i_pts, tk->i_last_dts + (mtime_t)(tk->i_default_duration >> 10));
- p_sys->i_pts = p_block->i_dts;
}
}
tk->i_last_dts = p_block->i_dts;
diff --git a/modules/demux/mkv/mkv.hpp b/modules/demux/mkv/mkv.hpp
index e09bcb4..1461d4a 100644
--- a/modules/demux/mkv/mkv.hpp
+++ b/modules/demux/mkv/mkv.hpp
@@ -188,6 +188,7 @@ typedef struct
char *psz_codec;
bool b_dts_only;
+ bool b_pts_only;
uint64_t i_default_duration;
float f_timecodescale;
More information about the vlc-commits
mailing list