Commit 050333c7 authored by Ago Allikmaa's avatar Ago Allikmaa Committed by Denis Charmet

Regression fix for non-SPU tracks in MKV containers.

Fixes track duration not being set for non-SPU tracks in MKV containers.
parent c91f3a9a
......@@ -222,6 +222,7 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
tk->psz_codec = NULL;
tk->b_dts_only = false;
tk->i_default_duration = 0;
tk->b_no_duration = false;
tk->f_timecodescale = 1.0;
tk->b_inited = false;
......@@ -1748,6 +1749,7 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
else if( !strcmp( p_tk->psz_codec, "S_VOBSUB" ) )
{
p_tk->fmt.i_codec = VLC_CODEC_SPU;
p_tk->b_no_duration = true;
if( p_tk->i_extra_data )
{
char *psz_start;
......
......@@ -602,11 +602,6 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
VLC_TS_INVALID;
continue;
}
case VLC_CODEC_SPU:
if( strcmp( tk->psz_codec, "S_VOBSUB" ) )
p_block->i_length = i_duration * tk-> f_timecodescale *
(double) p_segment->i_timescale / 1000.0;
break;
case VLC_CODEC_OPUS:
if( i_duration > 0 )
{
......@@ -673,6 +668,12 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
#if 0
msg_Dbg( p_demux, "block i_dts: %"PRId64" / i_pts: %"PRId64, p_block->i_dts, p_block->i_pts);
#endif
if( !tk->b_no_duration )
{
p_block->i_length = i_duration * tk-> f_timecodescale *
(double) p_segment->i_timescale / 1000.0;
}
/* FIXME remove when VLC_TS_INVALID work is done */
if( i == 0 || p_block->i_dts > VLC_TS_INVALID )
p_block->i_dts += VLC_TS_0;
......
......@@ -201,6 +201,7 @@ struct mkv_track_t
bool b_dts_only;
bool b_pts_only;
bool b_no_duration;
uint64_t i_default_duration;
float f_timecodescale;
mtime_t i_last_dts;
......
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