vlc_linux/vlc-3.0.16/modules/demux/mkv/matroska_segment.cpp
/* Here we try to load elements that were found in Seek Heads, but not yet parsed */
Here we try to load elements that were found in Seek Heads, but not yet parsed
Here we try to load elements that were found in Seek Heads but not yet parsed
bool matroska_segment_c::LoadSeekHeadItem( const EbmlCallbacks & ClassInfos, int64_t i_element_position )
{
    int64_t     i_sav_position = static_cast<int64_t>( es.I_O().getFilePointer() );
    EbmlElement *el;
    es.I_O().setFilePointer( i_element_position, seek_beginning );
    el = es.FindNextID( ClassInfos, 0xFFFFFFFFL);
    if( el == NULL )
    {
        msg_Err( &sys.demuxer, "cannot load some cues/chapters/tags etc. (broken seekhead or file)" );
        es.I_O().setFilePointer( i_sav_position, seek_beginning );
        return false;
    }
    if( MKV_CHECKED_PTR_DECL ( ksh_ptr, KaxSeekHead, el ) )
    {
        msg_Dbg( &sys.demuxer, "|   + Seek head" );
        if( i_seekhead_count < 10 )
        {
            if ( i_seekhead_position != i_element_position )
            {
                i_seekhead_position = i_element_position;
                ParseSeekHead( ksh_ptr );
            }
        }
    }
    else if( MKV_CHECKED_PTR_DECL ( ki_ptr, KaxInfo, el ) ) 
    {
        msg_Dbg( &sys.demuxer, "|   + Information" );
        if( i_info_position < 0 )
        {
            ParseInfo( ki_ptr );
            i_info_position = i_element_position;
        }
    }
    else if( MKV_CHECKED_PTR_DECL ( kt_ptr, KaxTracks, el ) ) 
    {
        msg_Dbg( &sys.demuxer, "|   + Tracks" );
        if( i_tracks_position < 0 )
            ParseTracks( kt_ptr );
        if ( tracks.size() == 0 )
        {
            msg_Err( &sys.demuxer, "No tracks supported" );
            delete el;
            es.I_O().setFilePointer( i_sav_position, seek_beginning );
            return false;
        }
        i_tracks_position = i_element_position;
    }
    else if( MKV_CHECKED_PTR_DECL ( kc_ptr, KaxCues, el ) )
    {
        msg_Dbg( &sys.demuxer, "|   + Cues" );
        if( i_cues_position < 0 )
        {
            LoadCues( kc_ptr );
            i_cues_position = i_element_position;
        }
    }
    else if( MKV_CHECKED_PTR_DECL ( ka_ptr, KaxAttachments, el ) )
    {
        msg_Dbg( &sys.demuxer, "|   + Attachments" );
        if( i_attachments_position < 0 )
        {
            ParseAttachments( ka_ptr );
            i_attachments_position = i_element_position;
        }
    }
    else if( MKV_CHECKED_PTR_DECL ( kc_ptr, KaxChapters, el ) )
    {
        msg_Dbg( &sys.demuxer, "|   + Chapters" );
        if( i_chapters_position < 0 )
        {
            ParseChapters( kc_ptr );
            i_chapters_position = i_element_position;
        }
    }
    else if( MKV_CHECKED_PTR_DECL ( kt_ptr, KaxTags, el ) )
    {
        msg_Dbg( &sys.demuxer, "|   + Tags" );
        if(tags.empty ())
        {
            LoadTags( kt_ptr );
        }
    }
    else
    {
        msg_Dbg( &sys.demuxer, "|   + LoadSeekHeadItem Unknown (%s)", typeid(*el).name() );
    }
    delete el;
    es.I_O().setFilePointer( i_sav_position, seek_beginning );
    return true;
}
bool matroska_segment_c :: LoadSeekHeadItem ( const EbmlCallbacks & ClassInfos , int64_t i_element_position ) { int64_t i_sav_position = static_cast < int64_t > ( es . I_O ( ) . getFilePointer ( ) ) ; EbmlElement * el ; es . I_O ( ) . setFilePointer ( i_element_position , seek_beginning ) ; el = es . FindNextID ( ClassInfos , 0xFFFFFFFFL ) ; if ( el == NULL ) { msg_Err ( & sys . demuxer , " " ) ; es . I_O ( ) . setFilePointer ( i_sav_position , seek_beginning ) ; return false ; } if ( MKV_CHECKED_PTR_DECL ( ksh_ptr , KaxSeekHead , el ) ) { msg_Dbg ( & sys . demuxer , " " ) ; if ( i_seekhead_count < 10 ) { if ( i_seekhead_position != i_element_position ) { i_seekhead_position = i_element_position ; ParseSeekHead ( ksh_ptr ) ; } } } else if ( MKV_CHECKED_PTR_DECL ( ki_ptr , KaxInfo , el ) ) { msg_Dbg ( & sys . demuxer , " " ) ; if ( i_info_position < 0 ) { ParseInfo ( ki_ptr ) ; i_info_position = i_element_position ; } } else if ( MKV_CHECKED_PTR_DECL ( kt_ptr , KaxTracks , el ) ) { msg_Dbg ( & sys . demuxer , " " ) ; if ( i_tracks_position < 0 ) ParseTracks ( kt_ptr ) ; if ( tracks . size ( ) == 0 ) { msg_Err ( & sys . demuxer , " " ) ; delete el ; es . I_O ( ) . setFilePointer ( i_sav_position , seek_beginning ) ; return false ; } i_tracks_position = i_element_position ; } else if ( MKV_CHECKED_PTR_DECL ( kc_ptr , KaxCues , el ) ) { msg_Dbg ( & sys . demuxer , " " ) ; if ( i_cues_position < 0 ) { LoadCues ( kc_ptr ) ; i_cues_position = i_element_position ; } } else if ( MKV_CHECKED_PTR_DECL ( ka_ptr , KaxAttachments , el ) ) { msg_Dbg ( & sys . demuxer , " " ) ; if ( i_attachments_position < 0 ) { ParseAttachments ( ka_ptr ) ; i_attachments_position = i_element_position ; } } else if ( MKV_CHECKED_PTR_DECL ( kc_ptr , KaxChapters , el ) ) { msg_Dbg ( & sys . demuxer , " " ) ; if ( i_chapters_position < 0 ) { ParseChapters ( kc_ptr ) ; i_chapters_position = i_element_position ; } } else if ( MKV_CHECKED_PTR_DECL ( kt_ptr , KaxTags , el ) ) { msg_Dbg ( & sys . demuxer , " " ) ; if ( tags . empty ( ) ) { LoadTags ( kt_ptr ) ; } } else { msg_Dbg ( & sys . demuxer , " " , typeid ( * el ) . name ( ) ) ; } delete el ; es . I_O ( ) . setFilePointer ( i_sav_position , seek_beginning ) ; return true ; }
Here we try to load elements that were found in Seek Heads, but not yet parsed
Here we try to load elements that were found in Seek Heads but not yet parsed
/* Multiple allowed */ // FIXME /* Multiple allowed, mandatory */ // FIXME /* Multiple allowed */