Commit 8d587e5c authored by Filip Roséen's avatar Filip Roséen Committed by Thomas Guillem

demux/mkv: use infinite chapter as last resort

This fixes issues where you try to seek in an mkv that does not have a
duration (ie. where the last chapter just goes on and on), and it is
especially important for mkvs that only contains one chapter (that
goes on forever).

Prior to this patch these would not play at all.
Signed-off-by: Steve Lhomme's avatarSteve Lhomme <robux4@videolabs.io>
Signed-off-by: Thomas Guillem's avatarThomas Guillem <thomas@gllm.fr>
parent f2756634
......@@ -408,6 +408,17 @@ virtual_chapter_c* virtual_edition_c::getChapterbyTimecode( int64_t time )
return vchapters[i]->getSubChapterbyTimecode( time );
}
if( vchapters.size() )
{
virtual_chapter_c* last_chapter = vchapters.back();
if( last_chapter->i_mk_virtual_start_time <= time &&
last_chapter->i_mk_virtual_stop_time < 0 )
{
return last_chapter;
}
}
return NULL;
}
......
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