Commit 255de00c authored by Laurent Aimar's avatar Laurent Aimar Committed by Jean-Baptiste Kempf

Fixed/improved support for video timestamp in mkv.

(cherry picked from commit 9adcbb2f05007beae7e8faf33b28ac921f5aa592)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent a14dadea
...@@ -829,6 +829,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time ) ...@@ -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.i_extra = tracks[i_track]->i_extra_data;
tracks[i_track]->fmt.p_extra = xmalloc( 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 ); 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 ) ) 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 ) ...@@ -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 ) ) else if( !strncmp( tracks[i_track]->psz_codec, "V_VP8", 5 ) )
{ {
tracks[i_track]->fmt.i_codec = VLC_CODEC_VP8; 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 ) ) else if( !strncmp( tracks[i_track]->psz_codec, "V_MPEG4", 7 ) )
{ {
......
...@@ -589,6 +589,11 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock ...@@ -589,6 +589,11 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
p_block->i_pts = VLC_TS_INVALID; p_block->i_pts = VLC_TS_INVALID;
p_block->i_dts = i_pts; 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 else
{ {
p_block->i_pts = i_pts; p_block->i_pts = i_pts;
...@@ -596,7 +601,6 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock ...@@ -596,7 +601,6 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
p_block->i_dts = p_block->i_pts; p_block->i_dts = p_block->i_pts;
else else
p_block->i_dts = min( i_pts, tk->i_last_dts + (mtime_t)(tk->i_default_duration >> 10)); 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; tk->i_last_dts = p_block->i_dts;
......
...@@ -188,6 +188,7 @@ typedef struct ...@@ -188,6 +188,7 @@ typedef struct
char *psz_codec; char *psz_codec;
bool b_dts_only; bool b_dts_only;
bool b_pts_only;
uint64_t i_default_duration; uint64_t i_default_duration;
float f_timecodescale; float f_timecodescale;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment