Commit 15060644 authored by Steve Lhomme's avatar Steve Lhomme

mkv.cpp: better handling of the seekpoint numbers

parent 3ae0db5e
......@@ -1459,14 +1459,15 @@ static void UpdateCurrentChapter( demux_t & demux, mtime_t i_pts )
/* 1st, we need to know in which chapter we are */
psz_curr_chapter = sys.editions[sys.i_current_edition].FindTimecode( i_pts );
if (sys.psz_current_chapter != NULL && psz_curr_chapter != NULL && sys.psz_current_chapter->i_seekpoint_num != psz_curr_chapter->i_seekpoint_num)
/* we have moved to a new chapter */
if (sys.psz_current_chapter != NULL && psz_curr_chapter != NULL && sys.psz_current_chapter != psz_curr_chapter)
{
if (sys.psz_current_chapter->i_seekpoint_num != psz_curr_chapter->i_seekpoint_num && psz_curr_chapter->i_seekpoint_num > 0)
{
demux.info.i_update |= INPUT_UPDATE_SEEKPOINT;
demux.info.i_seekpoint = psz_curr_chapter->i_seekpoint_num - 1;
}
sys.psz_current_chapter = psz_curr_chapter;
if (sys.editions[sys.i_current_edition].b_ordered )
{
/* TODO check if we need to silently seek to a new location in the stream (switch to another chapter) */
......@@ -1474,6 +1475,8 @@ static void UpdateCurrentChapter( demux_t & demux, mtime_t i_pts )
/* only seek after each duration >= end timecode of the current chapter */
}
}
sys.psz_current_chapter = psz_curr_chapter;
}
}
static void Seek( demux_t *p_demux, mtime_t i_date, double f_percent)
......@@ -3074,8 +3077,6 @@ int64_t chapter_item_t::RefreshChapters( bool b_ordered, int64_t i_prev_user_tim
i_user_end_time = i_end_time;
}
i_seekpoint_num = title.i_seekpoint;
if (b_display_seekpoint)
{
seekpoint_t *sk = vlc_seekpoint_New();
......@@ -3090,6 +3091,8 @@ int64_t chapter_item_t::RefreshChapters( bool b_ordered, int64_t i_prev_user_tim
title.seekpoint[title.i_seekpoint-1] = sk;
}
i_seekpoint_num = title.i_seekpoint;
return i_user_end_time;
}
......
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