[vlc-devel] [PATCH 19/34] mkv: cleaned matroska_segment_c::LoadCues
Filip Roséen
filip at videolabs.io
Fri May 6 19:08:58 CEST 2016
- Moved variables to a more narrow scope (where they belong)
- Properly ignore cue types that we currently cannot handle correctly
(since doing otherwise will lead to unexpected (and wrong) behavior
further down the road).
This should be fixed, but the changes required are rather big; and a
discussion regarding just how we should handle the relevant matroska
elements is necesary.
---
modules/demux/mkv/matroska_segment.cpp | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index 270ef0a..13b8cef 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -103,7 +103,6 @@ matroska_segment_c::~matroska_segment_c()
*****************************************************************************/
void matroska_segment_c::LoadCues( KaxCues *cues )
{
- bool b_invalid_cue;
EbmlElement *el;
if( b_cues )
@@ -117,6 +116,9 @@ void matroska_segment_c::LoadCues( KaxCues *cues )
{
if( MKV_IS_ID( el, KaxCuePoint ) )
{
+ uint64_t cue_position = -1;
+ mtime_t cue_mk_time = -1;
+
unsigned int track_id = 0;
bool b_invalid_cue = false;
@@ -141,6 +143,7 @@ void matroska_segment_c::LoadCues( KaxCues *cues )
b_invalid_cue = true;
break;
}
+ cue_mk_time = static_cast<uint64>( *kct_ptr ) * i_timescale / INT64_C(1000);
}
else if( MKV_IS_ID( el, KaxCueTrackPositions ) )
{
@@ -165,15 +168,24 @@ void matroska_segment_c::LoadCues( KaxCues *cues )
else if( MKV_CHECKED_PTR_DECL ( kccp_ptr, KaxCueClusterPosition, el ) )
{
kccp_ptr->ReadData( es.I_O() );
+ cue_position = segment->GetGlobalPosition( static_cast<uint64>( *kccp_ptr ) );
}
else if( MKV_CHECKED_PTR_DECL ( kcbn_ptr, KaxCueBlockNumber, el ) )
{
- kcbn_ptr->ReadData( es.I_O() );
+ VLC_UNUSED( kcbn_ptr );
}
#if LIBMATROSKA_VERSION >= 0x010401
else if( MKV_IS_ID( el, KaxCueRelativePosition ) )
{
- /* For future use */
+ b_invalid_cue = true; // since we do not support this type of cue: IGNORE
+ }
+ else if( MKV_IS_ID( el, KaxCueBlockNumber ) )
+ {
+ b_invalid_cue = true; // since we do not support this type of cue: IGNORE
+ }
+ else if( MKV_IS_ID( el, KaxCueReference ) )
+ {
+ b_invalid_cue = true; // since we do not support this type of cue: IGNORE
}
else if( MKV_IS_ID( el, KaxCueDuration ) )
{
--
2.8.2
More information about the vlc-devel
mailing list