Commit 2dba57ca authored by Filip Roséen's avatar Filip Roséen Committed by Jean-Baptiste Kempf

mkv: add every seen subtitle block as seekpoint

Currently there are issues outside of the demuxer that does not allow us
to display an "on-going" subtitle if we seek to a location where a
subtitle has started, but yet finished.

Since there are several mkv files in the wild where there is no proper
mkv-cue for every subtitle, we should add every subtitle block we see as
an index; and then use this for seeking (if we know about it, and have
to).

In general, every subtitle block is effectively a "keyframe"; meaning
that this hack is safe (at least enough to justify its purpose). Having
seekpoints for the subtitle track will allow us to send it to the
relevant decoder, and after we have support for "unfinished" subtitles;
mkv's will magically play along nicely.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 01e74784
......@@ -1118,15 +1118,18 @@ int matroska_segment_c::BlockGet( KaxBlock * & pp_block, KaxSimpleBlock * & pp_s
vars.block->ReadData( vars.obj->es.I_O() );
vars.block->SetParent( *vars.obj->cluster );
if( vars.obj->tracks[ kblock.TrackNum() ].fmt.i_cat == SPU_ES )
{
vars.obj->_seeker.add_seekpoint( kblock.TrackNum(), SegmentSeeker::Seekpoint::TRUSTED, kblock.GetElementPosition(), kblock.GlobalTimecode() / 1000 );
}
vars.obj->ep->Keep ();
}
E_CASE( KaxBlockDuration, kduration )
{
kduration.ReadData( vars.obj->es.I_O() );
vars.i_duration = static_cast<uint64>( kduration );
}
E_CASE( KaxReferenceBlock, kreference )
{
kreference.ReadData( vars.obj->es.I_O() );
......
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