Commit a0ee7281 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

MKV: divide i_default_duration by 1000 once and for all

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 3828eb93
......@@ -337,7 +337,8 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
KaxTrackDefaultDuration &defd = *(KaxTrackDefaultDuration*)l;
tk->i_default_duration = uint64(defd);
msg_Dbg( &sys.demuxer, "| | | + Track Default Duration=%" PRId64, uint64(defd) );
msg_Dbg( &sys.demuxer, "| | | + Track Default Duration=%" PRId64, tk->i_default_duration );
tk->i_default_duration /= 1000;
}
else if( MKV_IS_ID( l, KaxTrackTimecodeScale ) )
{
......@@ -532,7 +533,7 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
msg_Dbg( &sys.demuxer, "| | | + Track Video" );
tk->f_fps = 0.0;
tk->fmt.video.i_frame_rate_base = (unsigned int)(tk->i_default_duration / 1000);
tk->fmt.video.i_frame_rate_base = (unsigned int)tk->i_default_duration;
tk->fmt.video.i_frame_rate = 1000000;
for( unsigned int j = 0; j < tkv->ListSize(); j++ )
......
......@@ -604,7 +604,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
handle_real_audio(p_demux, tk, p_block, i_pts);
block_Release(p_block);
i_pts = ( tk->i_default_duration )?
i_pts + ( mtime_t )( tk->i_default_duration / 1000 ):
i_pts + ( mtime_t )tk->i_default_duration:
VLC_TS_INVALID;
continue;
}
......@@ -673,7 +673,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
if ( b_key_picture || b_discardable_picture )
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 / 1000 ) );
p_block->i_dts = min( i_pts, tk->i_last_dts + ( mtime_t )tk->i_default_duration );
}
}
if( p_block->i_dts > VLC_TS_INVALID &&
......@@ -701,7 +701,7 @@ msg_Dbg( p_demux, "block (track=%d) i_dts: %"PRId64" / i_pts: %"PRId64, tk->i_nu
/* use time stamp only for first block */
i_pts = ( tk->i_default_duration )?
i_pts + ( mtime_t )( tk->i_default_duration / 1000 ):
i_pts + ( mtime_t )tk->i_default_duration:
VLC_TS_INVALID;
}
}
......
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