Commit 8c93323c authored by Steve Lhomme's avatar Steve Lhomme

mkv.cpp: fix the chapter/edition ending time

parent ae27ee8f
......@@ -2763,15 +2763,16 @@ static void ParseChapterAtom( demux_t *p_demux, int i_level, EbmlMaster *ca, cha
{
KaxChapterTimeStart &start =*(KaxChapterTimeStart*)l;
sk->i_time_offset = uint64( start ) / I64C(1000);
chapters.i_start_time = sk->i_time_offset;
msg_Dbg( p_demux, "| | | | + ChapterTimeStart: %lld", sk->i_time_offset );
}
else if( MKV_IS_ID( l, KaxChapterTimeEnd ) )
{
KaxChapterTimeEnd &end =*(KaxChapterTimeEnd*)l;
int64_t i_end = uint64( end );
chapters.i_end_time = uint64( end ) / I64C(1000);
msg_Dbg( p_demux, "| | | | + ChapterTimeEnd: %lld", i_end );
msg_Dbg( p_demux, "| | | | + ChapterTimeEnd: %lld", chapters.i_end_time );
}
else if( MKV_IS_ID( l, KaxChapterDisplay ) )
{
......@@ -2844,6 +2845,7 @@ static void ParseChapters( demux_t *p_demux, EbmlElement *chapters )
unsigned int i;
int i_upper_level = 0;
int i_default_edition = 0;
float f_duration;
/* Master elements */
m = static_cast<EbmlMaster *>(chapters);
......@@ -2906,7 +2908,9 @@ static void ParseChapters( demux_t *p_demux, EbmlElement *chapters )
if ( p_sys->editions[i_default_edition].b_ordered )
{
/* update the duration of the segment according to the sum of all sub chapters */
p_sys->f_duration = p_sys->editions[i_default_edition].Duration();
f_duration = p_sys->editions[i_default_edition].Duration() / I64C(1000);
if (f_duration > 0.0)
p_sys->f_duration = f_duration;
}
}
......@@ -3069,7 +3073,7 @@ int64_t chapter_item_t::RefreshChapters( bool b_ordered, int64_t i_prev_user_tim
}
else
{
i_user_end_time = i_user_start_time;
i_user_end_time = i_user_time;
}
}
else
......
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