Commit 9adcbb2f authored by Laurent Aimar's avatar Laurent Aimar

Fixed/improved support for video timestamp in mkv.

parent 07990fcd
...@@ -831,6 +831,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time ) ...@@ -831,6 +831,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 ) )
{ {
...@@ -861,6 +862,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time ) ...@@ -861,6 +862,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;
......
...@@ -187,6 +187,7 @@ typedef struct ...@@ -187,6 +187,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