[vlc-devel] [PATCH 3/8] mkv: prefix variables from virtual elements with a 'v'

Steve Lhomme robux4 at videolabs.io
Wed Mar 16 13:43:26 CET 2016


---
 modules/demux/mkv/chapter_command.cpp |  88 +++++++++---------
 modules/demux/mkv/demux.cpp           |  82 ++++++++---------
 modules/demux/mkv/demux.hpp           |  14 +--
 modules/demux/mkv/mkv.cpp             |  26 +++---
 modules/demux/mkv/util.cpp            |   2 +-
 modules/demux/mkv/virtual_segment.cpp | 166 +++++++++++++++++-----------------
 modules/demux/mkv/virtual_segment.hpp |  28 +++---
 7 files changed, 203 insertions(+), 203 deletions(-)

diff --git a/modules/demux/mkv/chapter_command.cpp b/modules/demux/mkv/chapter_command.cpp
index 93403a9..966c339 100644
--- a/modules/demux/mkv/chapter_command.cpp
+++ b/modules/demux/mkv/chapter_command.cpp
@@ -171,8 +171,8 @@ bool dvd_command_interpretor_c::Interpret( const binary * p_command, size_t i_si
     if ( i_size != 8 )
         return false;
 
-    virtual_segment_c *p_segment = NULL;
-    virtual_chapter_c *p_chapter = NULL;
+    virtual_segment_c *p_vsegment = NULL;
+    virtual_chapter_c *p_vchapter = NULL;
     bool f_result = false;
     uint16 i_command = ( p_command[0] << 8 ) + p_command[1];
 
@@ -307,10 +307,10 @@ bool dvd_command_interpretor_c::Interpret( const binary * p_command, size_t i_si
             msg_Dbg( &sys.demuxer, "JumpTT %d", i_title );
 
             // find in the ChapProcessPrivate matching this Title level
-            p_chapter = sys.BrowseCodecPrivate( 1, MatchTitleNumber, &i_title, sizeof(i_title), p_segment );
-            if ( p_segment != NULL )
+            p_vchapter = sys.BrowseCodecPrivate( 1, MatchTitleNumber, &i_title, sizeof(i_title), p_vsegment );
+            if ( p_vsegment != NULL )
             {
-                sys.JumpTo( *p_segment, p_chapter );
+                sys.JumpTo( *p_vsegment, p_vchapter );
                 f_result = true;
             }
 
@@ -350,10 +350,10 @@ bool dvd_command_interpretor_c::Interpret( const binary * p_command, size_t i_si
                         msg_Dbg( &sys.demuxer, "CallSS <unknown> (rsm_cell %x)", p_command[4]);
                         break;
                     }
-                    p_chapter = sys.BrowseCodecPrivate( 1, MatchPgcType, &p_type, 1, p_segment );
-                    if ( p_segment != NULL )
+                    p_vchapter = sys.BrowseCodecPrivate( 1, MatchPgcType, &p_type, 1, p_vsegment );
+                    if ( p_vsegment != NULL )
                     {
-                        sys.JumpTo( *p_segment, p_chapter );
+                        sys.JumpTo( *p_vsegment, p_vchapter );
                         f_result = true;
                     }
                 break;
@@ -404,13 +404,13 @@ bool dvd_command_interpretor_c::Interpret( const binary * p_command, size_t i_si
                         break;
                     }
                     // find the VMG
-                    p_chapter = sys.BrowseCodecPrivate( 1, MatchIsVMG, NULL, 0, p_segment );
-                    if ( p_segment != NULL )
+                    p_vchapter = sys.BrowseCodecPrivate( 1, MatchIsVMG, NULL, 0, p_vsegment );
+                    if ( p_vsegment != NULL )
                     {
-                        p_chapter = p_segment->BrowseCodecPrivate( 1, MatchPgcType, &p_type, 1 );
-                        if ( p_chapter != NULL )
+                        p_vchapter = p_vsegment->BrowseCodecPrivate( 1, MatchPgcType, &p_type, 1 );
+                        if ( p_vchapter != NULL )
                         {
-                            sys.JumpTo( *p_segment, p_chapter );
+                            sys.JumpTo( *p_vsegment, p_vchapter );
                             f_result = true;
                         }
                     }
@@ -442,19 +442,19 @@ bool dvd_command_interpretor_c::Interpret( const binary * p_command, size_t i_si
                         break;
                     }
 
-                    p_chapter = sys.BrowseCodecPrivate( 1, MatchVTSMNumber, &p_command[4], 1, p_segment );
+                    p_vchapter = sys.BrowseCodecPrivate( 1, MatchVTSMNumber, &p_command[4], 1, p_vsegment );
 
-                    if ( p_segment != NULL && p_chapter != NULL )
+                    if ( p_vsegment != NULL && p_vchapter != NULL )
                     {
                         // find the title in the VTS
-                        p_chapter = p_chapter->BrowseCodecPrivate( 1, MatchTitleNumber, &p_command[3], 1 );
-                        if ( p_chapter != NULL )
+                        p_vchapter = p_vchapter->BrowseCodecPrivate( 1, MatchTitleNumber, &p_command[3], 1 );
+                        if ( p_vchapter != NULL )
                         {
                             // find the specified menu in the VTSM
-                            p_chapter = p_segment->BrowseCodecPrivate( 1, MatchPgcType, &p_type, 1 );
-                            if ( p_chapter != NULL )
+                            p_vchapter = p_vsegment->BrowseCodecPrivate( 1, MatchPgcType, &p_type, 1 );
+                            if ( p_vchapter != NULL )
                             {
-                                sys.JumpTo( *p_segment, p_chapter );
+                                sys.JumpTo( *p_vsegment, p_vchapter );
                                 f_result = true;
                             }
                         }
@@ -478,25 +478,25 @@ bool dvd_command_interpretor_c::Interpret( const binary * p_command, size_t i_si
             msg_Dbg( &sys.demuxer, "JumpVTS Title (%d) PTT (%d)", i_title, i_ptt);
 
             // find the current VTS content segment
-            p_chapter = sys.p_current_segment->BrowseCodecPrivate( 1, MatchIsDomain, NULL, 0 );
-            if ( p_chapter != NULL )
+            p_vchapter = sys.p_current_vsegment->BrowseCodecPrivate( 1, MatchIsDomain, NULL, 0 );
+            if ( p_vchapter != NULL )
             {
-                int16 i_curr_title = ( p_chapter->p_chapter )? p_chapter->p_chapter->GetTitleNumber() : 0;
+                int16 i_curr_title = ( p_vchapter->p_chapter )? p_vchapter->p_chapter->GetTitleNumber() : 0;
                 if ( i_curr_title > 0 )
                 {
-                    p_chapter = sys.BrowseCodecPrivate( 1, MatchVTSNumber, &i_curr_title, sizeof(i_curr_title), p_segment );
+                    p_vchapter = sys.BrowseCodecPrivate( 1, MatchVTSNumber, &i_curr_title, sizeof(i_curr_title), p_vsegment );
 
-                    if ( p_segment != NULL && p_chapter != NULL )
+                    if ( p_vsegment != NULL && p_vchapter != NULL )
                     {
                         // find the title in the VTS
-                        p_chapter = p_chapter->BrowseCodecPrivate( 1, MatchTitleNumber, &i_title, sizeof(i_title) );
-                        if ( p_chapter != NULL )
+                        p_vchapter = p_vchapter->BrowseCodecPrivate( 1, MatchTitleNumber, &i_title, sizeof(i_title) );
+                        if ( p_vchapter != NULL )
                         {
                             // find the chapter in the title
-                            p_chapter = p_chapter->BrowseCodecPrivate( 1, MatchChapterNumber, &i_ptt, sizeof(i_ptt) );
-                            if ( p_chapter != NULL )
+                            p_vchapter = p_vchapter->BrowseCodecPrivate( 1, MatchChapterNumber, &i_ptt, sizeof(i_ptt) );
+                            if ( p_vchapter != NULL )
                             {
-                                sys.JumpTo( *p_segment, p_chapter );
+                                sys.JumpTo( *p_vsegment, p_vchapter );
                                 f_result = true;
                             }
                         }
@@ -526,12 +526,12 @@ bool dvd_command_interpretor_c::Interpret( const binary * p_command, size_t i_si
             uint16 i_pgcn = (p_command[6] << 8) + p_command[7];
 
             msg_Dbg( &sys.demuxer, "Link PGCN(%d)", i_pgcn );
-            p_chapter = sys.p_current_segment->BrowseCodecPrivate( 1, MatchPgcNumber, &i_pgcn, 2 );
-            if ( p_chapter != NULL )
+            p_vchapter = sys.p_current_vsegment->BrowseCodecPrivate( 1, MatchPgcNumber, &i_pgcn, 2 );
+            if ( p_vchapter != NULL )
             {
-                if ( !p_chapter->Enter( true ) )
+                if ( !p_vchapter->Enter( true ) )
                     // jump to the location in the found segment
-                    sys.p_current_segment->Seek( sys.demuxer, p_chapter->i_mk_virtual_start_time, p_chapter, -1 );
+                    sys.p_current_vsegment->Seek( sys.demuxer, p_vchapter->i_mk_virtual_start_time, p_vchapter, -1 );
 
                 f_result = true;
             }
@@ -541,15 +541,15 @@ bool dvd_command_interpretor_c::Interpret( const binary * p_command, size_t i_si
         {
             uint8 i_cn = p_command[7];
 
-            p_chapter = sys.p_current_segment->CurrentChapter();
+            p_vchapter = sys.p_current_vsegment->CurrentChapter();
 
             msg_Dbg( &sys.demuxer, "LinkCN (cell %d)", i_cn );
-            p_chapter = p_chapter->BrowseCodecPrivate( 1, MatchCellNumber, &i_cn, 1 );
-            if ( p_chapter != NULL )
+            p_vchapter = p_vchapter->BrowseCodecPrivate( 1, MatchCellNumber, &i_cn, 1 );
+            if ( p_vchapter != NULL )
             {
-                if ( !p_chapter->Enter( true ) )
+                if ( !p_vchapter->Enter( true ) )
                     // jump to the location in the found segment
-                    sys.p_current_segment->Seek( sys.demuxer, p_chapter->i_mk_virtual_start_time, p_chapter, -1 );
+                    sys.p_current_vsegment->Seek( sys.demuxer, p_vchapter->i_mk_virtual_start_time, p_vchapter, -1 );
 
                 f_result = true;
             }
@@ -736,15 +736,15 @@ bool matroska_script_interpretor_c::Interpret( const binary * p_command, size_t
         std::string st = sz_command.substr( i+1, j-i-1 );
         int64_t i_chapter_uid = atoi( st.c_str() );
 
-        virtual_segment_c *p_segment;
-        virtual_chapter_c *p_chapter = sys.FindChapter( i_chapter_uid, p_segment );
+        virtual_segment_c *p_vsegment;
+        virtual_chapter_c *p_vchapter = sys.FindChapter( i_chapter_uid, p_vsegment );
 
-        if ( p_chapter == NULL )
+        if ( p_vchapter == NULL )
             msg_Dbg( &sys.demuxer, "Chapter %" PRId64 " not found", i_chapter_uid);
         else
         {
-            if ( !p_chapter->EnterAndLeave( sys.p_current_segment->CurrentChapter() ) )
-                p_segment->Seek( sys.demuxer, p_chapter->i_mk_virtual_start_time, p_chapter, -1 );
+            if ( !p_vchapter->EnterAndLeave( sys.p_current_vsegment->CurrentChapter() ) )
+                p_vsegment->Seek( sys.demuxer, p_vchapter->i_mk_virtual_start_time, p_vchapter, -1 );
             b_result = true;
         }
     }
diff --git a/modules/demux/mkv/demux.cpp b/modules/demux/mkv/demux.cpp
index 78eb219..6d83897 100644
--- a/modules/demux/mkv/demux.cpp
+++ b/modules/demux/mkv/demux.cpp
@@ -437,8 +437,8 @@ demux_sys_t::~demux_sys_t()
         delete streams[i];
     for ( i=0; i<opened_segments.size(); i++ )
         delete opened_segments[i];
-    for ( i=0; i<used_segments.size(); i++ )
-        delete used_segments[i];
+    for ( i=0; i<used_vsegments.size(); i++ )
+        delete used_vsegments[i];
     for ( i=0; i<stored_attachments.size(); i++ )
         delete stored_attachments[i];
     if( meta ) vlc_meta_Delete( meta );
@@ -652,34 +652,34 @@ void demux_sys_t::PreloadFamily( const matroska_segment_c & of_segment )
 bool demux_sys_t::PreloadLinked()
 {
     size_t i, j, ij = 0;
-    virtual_segment_c *p_seg;
+    virtual_segment_c *p_vseg;
 
-    p_current_segment = opened_segments.size() ? new (std::nothrow) virtual_segment_c( *(opened_segments[0]), opened_segments ) : NULL;
-    if ( !p_current_segment )
+    p_current_vsegment = opened_segments.size() ? new (std::nothrow) virtual_segment_c( *(opened_segments[0]), opened_segments ) : NULL;
+    if ( !p_current_vsegment )
         return false;
 
-    used_segments.push_back( p_current_segment );
+    used_vsegments.push_back( p_current_vsegment );
 
     for ( i=1; i< opened_segments.size(); i++ )
     {
         /* add segments from the same family to used_segments */
         if ( opened_segments[0]->SameFamily( *(opened_segments[i]) ) )
         {
-            virtual_segment_c *p_virtual_segment = new (std::nothrow) virtual_segment_c( *(opened_segments[i]), opened_segments );
-            if ( p_virtual_segment != NULL )
-                used_segments.push_back( p_virtual_segment );
+            virtual_segment_c *p_vsegment = new (std::nothrow) virtual_segment_c( *(opened_segments[i]), opened_segments );
+            if ( likely(p_vsegment != NULL) )
+                used_vsegments.push_back( p_vsegment );
         }
     }
 
     // publish all editions of all usable segment
-    for ( i=0; i< used_segments.size(); i++ )
+    for ( i=0; i< used_vsegments.size(); i++ )
     {
-        p_seg = used_segments[i];
-        if ( p_seg->Editions() != NULL )
+        p_vseg = used_vsegments[i];
+        if ( p_vseg->Editions() != NULL )
         {
-            for ( j=0; j<p_seg->Editions()->size(); j++ )
+            for ( j=0; j<p_vseg->Editions()->size(); j++ )
             {
-                virtual_edition_c * p_ved = (*p_seg->Editions())[j];
+                virtual_edition_c * p_ved = (*p_vseg->Editions())[j];
                 input_title_t *p_title = vlc_input_title_New();
                 int i_chapters;
 
@@ -729,7 +729,7 @@ bool demux_sys_t::PreloadLinked()
                 titles.push_back( p_title );
             }
         }
-        p_seg->i_sys_title = p_seg->i_current_edition;
+        p_vseg->i_sys_title = p_vseg->i_current_edition;
     }
 
     // TODO decide which segment should be first used (VMG for DVD)
@@ -768,48 +768,48 @@ void demux_sys_t::FreeUnused()
     }
 }
 
-bool demux_sys_t::PreparePlayback( virtual_segment_c *p_new_segment )
+bool demux_sys_t::PreparePlayback( virtual_segment_c *p_new_vsegment )
 {
-    if ( p_new_segment != NULL && p_new_segment != p_current_segment )
+    if ( p_new_vsegment != NULL && p_new_vsegment != p_current_vsegment )
     {
-        if ( p_current_segment != NULL && p_current_segment->CurrentSegment() != NULL )
-            p_current_segment->CurrentSegment()->UnSelect();
+        if ( p_current_vsegment != NULL && p_current_vsegment->CurrentSegment() != NULL )
+            p_current_vsegment->CurrentSegment()->UnSelect();
 
-        p_current_segment = p_new_segment;
-        i_current_title = p_new_segment->i_sys_title;
+        p_current_vsegment = p_new_vsegment;
+        i_current_title = p_new_vsegment->i_sys_title;
     }
-    if( !p_current_segment->CurrentSegment() )
+    if( !p_current_vsegment->CurrentSegment() )
         return false;
-    if( !p_current_segment->CurrentSegment()->b_cues )
-        msg_Warn( &p_current_segment->CurrentSegment()->sys.demuxer, "no cues/empty cues found->seek won't be precise" );
+    if( !p_current_vsegment->CurrentSegment()->b_cues )
+        msg_Warn( &p_current_vsegment->CurrentSegment()->sys.demuxer, "no cues/empty cues found->seek won't be precise" );
 
-    f_duration = p_current_segment->Duration();
+    f_duration = p_current_vsegment->Duration();
 
     /* add information */
-    p_current_segment->CurrentSegment()->InformationCreate( );
-    p_current_segment->CurrentSegment()->Select( 0 );
+    p_current_vsegment->CurrentSegment()->InformationCreate( );
+    p_current_vsegment->CurrentSegment()->Select( 0 );
 
     /* Seek to the beginning */
-    p_current_segment->Seek(p_current_segment->CurrentSegment()->sys.demuxer,
+    p_current_vsegment->Seek(p_current_vsegment->CurrentSegment()->sys.demuxer,
                             0, NULL, -1);
 
     return true;
 }
 
-void demux_sys_t::JumpTo( virtual_segment_c & vsegment, virtual_chapter_c * p_chapter )
+void demux_sys_t::JumpTo( virtual_segment_c & vsegment, virtual_chapter_c * p_vchapter )
 {
     // if the segment is not part of the current segment, select the new one
-    if ( &vsegment != p_current_segment )
+    if ( &vsegment != p_current_vsegment )
     {
         PreparePlayback( &vsegment );
     }
 
-    if ( p_chapter )
+    if ( p_vchapter )
     {
-        if ( !p_chapter->p_chapter || !p_chapter->p_chapter->Enter( true ) )
+        if ( !p_vchapter->p_chapter || !p_vchapter->p_chapter->Enter( true ) )
         {
             // jump to the location in the found segment
-            vsegment.Seek( demuxer, p_chapter->i_mk_virtual_start_time, p_chapter, -1 );
+            vsegment.Seek( demuxer, p_vchapter->i_mk_virtual_start_time, p_vchapter, -1 );
         }
     }
 
@@ -829,30 +829,30 @@ virtual_chapter_c *demux_sys_t::BrowseCodecPrivate( unsigned int codec_id,
                                         bool (*match)(const chapter_codec_cmds_c &data, const void *p_cookie, size_t i_cookie_size ),
                                         const void *p_cookie,
                                         size_t i_cookie_size,
-                                        virtual_segment_c * &p_segment_found )
+                                        virtual_segment_c * &p_vsegment_found )
 {
     virtual_chapter_c *p_result = NULL;
-    for (size_t i=0; i<used_segments.size(); i++)
+    for (size_t i=0; i<used_vsegments.size(); i++)
     {
-        p_result = used_segments[i]->BrowseCodecPrivate( codec_id, match, p_cookie, i_cookie_size );
+        p_result = used_vsegments[i]->BrowseCodecPrivate( codec_id, match, p_cookie, i_cookie_size );
         if ( p_result != NULL )
         {
-            p_segment_found = used_segments[i];
+            p_vsegment_found = used_vsegments[i];
             break;
         }
     }
     return p_result;
 }
 
-virtual_chapter_c *demux_sys_t::FindChapter( int64_t i_find_uid, virtual_segment_c * & p_segment_found )
+virtual_chapter_c *demux_sys_t::FindChapter( int64_t i_find_uid, virtual_segment_c * & p_vsegment_found )
 {
     virtual_chapter_c *p_result = NULL;
-    for (size_t i=0; i<used_segments.size(); i++)
+    for (size_t i=0; i<used_vsegments.size(); i++)
     {
-        p_result = used_segments[i]->FindChapter( i_find_uid );
+        p_result = used_vsegments[i]->FindChapter( i_find_uid );
         if ( p_result != NULL )
         {
-            p_segment_found = used_segments[i];
+            p_vsegment_found = used_vsegments[i];
             break;
         }
     }
diff --git a/modules/demux/mkv/demux.hpp b/modules/demux/mkv/demux.hpp
index 9310e11..44e8bd4 100644
--- a/modules/demux/mkv/demux.hpp
+++ b/modules/demux/mkv/demux.hpp
@@ -337,7 +337,7 @@ public:
         ,i_mk_chapter_time(0)
         ,meta(NULL)
         ,i_current_title(0)
-        ,p_current_segment(NULL)
+        ,p_current_vsegment(NULL)
         ,dvd_interpretor( *this )
         ,f_duration(-1.0)
         ,p_input(NULL)
@@ -364,8 +364,8 @@ public:
     std::vector<matroska_stream_c*>  streams;
     std::vector<attachment_c*>       stored_attachments;
     std::vector<matroska_segment_c*> opened_segments;
-    std::vector<virtual_segment_c*>  used_segments;
-    virtual_segment_c                *p_current_segment;
+    std::vector<virtual_segment_c*>  used_vsegments;
+    virtual_segment_c                *p_current_vsegment;
 
     dvd_command_interpretor_c        dvd_interpretor;
 
@@ -377,15 +377,15 @@ public:
                                         bool (*match)(const chapter_codec_cmds_c &data, const void *p_cookie, size_t i_cookie_size ),
                                         const void *p_cookie,
                                         size_t i_cookie_size,
-                                        virtual_segment_c * & p_segment_found );
-    virtual_chapter_c *FindChapter( int64_t i_find_uid, virtual_segment_c * & p_segment_found );
+                                        virtual_segment_c * & p_vsegment_found );
+    virtual_chapter_c *FindChapter( int64_t i_find_uid, virtual_segment_c * & p_vsegment_found );
 
     void PreloadFamily( const matroska_segment_c & of_segment );
     bool PreloadLinked();
     void FreeUnused();
-    bool PreparePlayback( virtual_segment_c *p_new_segment );
+    bool PreparePlayback( virtual_segment_c *p_new_vsegment );
     matroska_stream_c *AnalyseAllSegmentsFound( demux_t *p_demux, EbmlStream *p_estream, bool b_initial = false );
-    void JumpTo( virtual_segment_c & p_segment, virtual_chapter_c * p_chapter );
+    void JumpTo( virtual_segment_c & p_vsegment, virtual_chapter_c * p_vchapter );
 
     void InitUi();
     void CleanUi();
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index 9e83ffb..0729318 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -83,7 +83,7 @@ struct demux_sys_t;
 
 static int  Demux  ( demux_t * );
 static int  Control( demux_t *, int, va_list );
-static void Seek   ( demux_t *, mtime_t i_mk_date, double f_percent, virtual_chapter_c *p_chapter );
+static void Seek   ( demux_t *, mtime_t i_mk_date, double f_percent, virtual_chapter_c *p_vchapter );
 
 /*****************************************************************************
  * Open: initializes matroska demux structures
@@ -273,7 +273,7 @@ static void Close( vlc_object_t *p_this )
 {
     demux_t     *p_demux = reinterpret_cast<demux_t*>( p_this );
     demux_sys_t *p_sys   = p_demux->p_sys;
-    virtual_segment_c *p_vsegment = p_sys->p_current_segment;
+    virtual_segment_c *p_vsegment = p_sys->p_current_vsegment;
     if( p_vsegment )
     {
         matroska_segment_c *p_segment = p_vsegment->CurrentSegment();
@@ -383,9 +383,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             i_idx = va_arg( args, int );
             if(i_idx <  p_sys->titles.size() && p_sys->titles[i_idx]->i_seekpoint)
             {
-                p_sys->p_current_segment->i_current_edition = i_idx;
+                p_sys->p_current_vsegment->i_current_edition = i_idx;
                 p_sys->i_current_title = i_idx;
-                p_sys->p_current_segment->p_current_chapter = p_sys->p_current_segment->editions[p_sys->p_current_segment->i_current_edition]->getChapterbyTimecode(0);
+                p_sys->p_current_vsegment->p_current_vchapter = p_sys->p_current_vsegment->veditions[p_sys->p_current_vsegment->i_current_edition]->getChapterbyTimecode(0);
 
                 Seek( p_demux, static_cast<int64_t>( p_sys->titles[i_idx]->seekpoint[0]->i_time_offset ), -1, NULL);
                 p_demux->info.i_update |= INPUT_UPDATE_SEEKPOINT|INPUT_UPDATE_TITLE;
@@ -412,9 +412,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         case DEMUX_GET_FPS:
             pf = va_arg( args, double * );
             *pf = 0.0;
-            if( p_sys->p_current_segment && p_sys->p_current_segment->CurrentSegment() )
+            if( p_sys->p_current_vsegment && p_sys->p_current_vsegment->CurrentSegment() )
             {
-                const matroska_segment_c *p_segment = p_sys->p_current_segment->CurrentSegment();
+                const matroska_segment_c *p_segment = p_sys->p_current_vsegment->CurrentSegment();
                 for( size_t i = 0; i < p_segment->tracks.size(); i++ )
                 {
                     mkv_track_t *tk = p_segment->tracks[i];
@@ -438,10 +438,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
 }
 
 /* Seek */
-static void Seek( demux_t *p_demux, mtime_t i_mk_date, double f_percent, virtual_chapter_c *p_chapter )
+static void Seek( demux_t *p_demux, mtime_t i_mk_date, double f_percent, virtual_chapter_c *p_vchapter )
 {
     demux_sys_t        *p_sys = p_demux->p_sys;
-    virtual_segment_c  *p_vsegment = p_sys->p_current_segment;
+    virtual_segment_c  *p_vsegment = p_sys->p_current_vsegment;
     matroska_segment_c *p_segment = p_vsegment->CurrentSegment();
     int64_t            i_global_position = -1;
 
@@ -501,7 +501,7 @@ static void Seek( demux_t *p_demux, mtime_t i_mk_date, double f_percent, virtual
             }
         }
     }
-    p_vsegment->Seek( *p_demux, i_mk_date, p_chapter, i_global_position );
+    p_vsegment->Seek( *p_demux, i_mk_date, p_vchapter, i_global_position );
 }
 
 /* Needed by matroska_segment::Seek() and Seek */
@@ -510,7 +510,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
                   bool b_discardable_picture )
 {
     demux_sys_t        *p_sys = p_demux->p_sys;
-    matroska_segment_c *p_segment = p_sys->p_current_segment->CurrentSegment();
+    matroska_segment_c *p_segment = p_sys->p_current_vsegment->CurrentSegment();
 
     if( !p_segment ) return;
 
@@ -712,13 +712,13 @@ static int Demux( demux_t *p_demux)
 
     vlc_mutex_locker( &p_sys->lock_demuxer );
 
-    virtual_segment_c  *p_vsegment = p_sys->p_current_segment;
+    virtual_segment_c  *p_vsegment = p_sys->p_current_vsegment;
 
     if( p_sys->i_pts >= p_sys->i_start_pts )
     {
         if ( p_vsegment->UpdateCurrentToChapter( *p_demux ) )
             return 1;
-        p_vsegment = p_sys->p_current_segment;
+        p_vsegment = p_sys->p_current_vsegment;
     }
 
     matroska_segment_c *p_segment = p_vsegment->CurrentSegment();
@@ -776,7 +776,7 @@ static int Demux( demux_t *p_demux)
             delete block;
             return 1;
         }
-        p_vsegment = p_sys->p_current_segment;
+        p_vsegment = p_sys->p_current_vsegment;
     }
 
     if ( p_vsegment->CurrentEdition() &&
diff --git a/modules/demux/mkv/util.cpp b/modules/demux/mkv/util.cpp
index d30ce98..eb817d6 100644
--- a/modules/demux/mkv/util.cpp
+++ b/modules/demux/mkv/util.cpp
@@ -249,7 +249,7 @@ void handle_real_audio(demux_t * p_demux, mkv_track_t * p_tk, block_t * p_blk, m
 void send_Block( demux_t * p_demux, mkv_track_t * p_tk, block_t * p_block, unsigned int i_number_frames, mtime_t i_duration )
 {
     demux_sys_t        *p_sys = p_demux->p_sys;
-    matroska_segment_c *p_segment = p_sys->p_current_segment->CurrentSegment();
+    matroska_segment_c *p_segment = p_sys->p_current_vsegment->CurrentSegment();
 
     if( p_tk->fmt.i_cat == AUDIO_ES && p_tk->i_chans_to_reorder )
     {
diff --git a/modules/demux/mkv/virtual_segment.cpp b/modules/demux/mkv/virtual_segment.cpp
index 7773a5b..74331c2 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -100,8 +100,8 @@ virtual_chapter_c * virtual_chapter_c::CreateVirtualChapter( chapter_item_c * p_
 
 virtual_chapter_c::~virtual_chapter_c()
 {
-    for( size_t i = 0 ; i < sub_chapters.size(); i++ )
-        delete sub_chapters[i];
+    for( size_t i = 0 ; i < sub_vchapters.size(); i++ )
+        delete sub_vchapters[i];
 }
 
 
@@ -123,10 +123,10 @@ virtual_edition_c::virtual_edition_c( chapter_edition_c * p_edit, matroska_segme
                                                                                    main_segment, opened_segments,
                                                                                    usertime_offset, b_ordered );
             if( p_vchap )
-                chapters.push_back( p_vchap );
+                vchapters.push_back( p_vchap );
         }
-        if( chapters.size() )
-            i_duration = chapters[ chapters.size() - 1 ]->i_mk_virtual_stop_time;
+        if( vchapters.size() )
+            i_duration = vchapters[ vchapters.size() - 1 ]->i_mk_virtual_stop_time;
         else
             i_duration = 0; /* Empty ordered editions will be ignored */
     }
@@ -157,7 +157,7 @@ virtual_edition_c::virtual_edition_c( chapter_edition_c * p_edit, matroska_segme
                 p_vchap = virtual_chapter_c::CreateVirtualChapter( p_chap, *p_prev, opened_segments, tmp, b_ordered );
 
                 if( p_vchap )
-                    chapters.insert( chapters.begin(), p_vchap );
+                    vchapters.insert( vchapters.begin(), p_vchap );
 
                 p_cur = p_prev;
                 b_fake_ordered = true;
@@ -172,7 +172,7 @@ virtual_edition_c::virtual_edition_c( chapter_edition_c * p_edit, matroska_segme
         p_vchap = virtual_chapter_c::CreateVirtualChapter( (chapter_item_c*) p_edit, main_segment,
                                                            opened_segments, tmp, b_ordered );
         if( p_vchap )
-            chapters.push_back( p_vchap );
+            vchapters.push_back( p_vchap );
 
         /* Append next linked segments */
         for( int limit = 0; limit < 10 && p_cur->p_next_segment_uid; limit++ )
@@ -194,7 +194,7 @@ virtual_edition_c::virtual_edition_c( chapter_edition_c * p_edit, matroska_segme
                  p_vchap = virtual_chapter_c::CreateVirtualChapter( p_chap, *p_next, opened_segments, tmp, b_ordered );
 
                 if( p_vchap )
-                    chapters.push_back( p_vchap );
+                    vchapters.push_back( p_vchap );
 
                 p_cur = p_next;
                 b_fake_ordered = true;
@@ -218,16 +218,16 @@ virtual_edition_c::virtual_edition_c( chapter_edition_c * p_edit, matroska_segme
 
 virtual_edition_c::~virtual_edition_c()
 {
-    for( size_t i = 0; i < chapters.size(); i++ )
-        delete chapters[i];
+    for( size_t i = 0; i < vchapters.size(); i++ )
+        delete vchapters[i];
 }
 
 void virtual_edition_c::retimeSubChapters( virtual_chapter_c * p_vchap )
 {
     mtime_t i_mk_stop_time = p_vchap->i_mk_virtual_stop_time;
-    for( size_t i = p_vchap->sub_chapters.size(); i-- > 0; )
+    for( size_t i = p_vchap->sub_vchapters.size(); i-- > 0; )
     {
-        virtual_chapter_c * p_vsubchap = p_vchap->sub_chapters[i];
+        virtual_chapter_c * p_vsubchap = p_vchap->sub_vchapters[i];
         //p_vsubchap->i_mk_virtual_start_time += p_vchap->i_mk_virtual_start_time;
 
         /*FIXME we artificially extend stop time if they were there before...*/
@@ -248,9 +248,9 @@ void virtual_edition_c::retimeChapters()
     i_duration = 0;
 
     /* On non ordered editions we have one top chapter == one segment */
-    for( size_t i = 0; i < chapters.size(); i++ )
+    for( size_t i = 0; i < vchapters.size(); i++ )
     {
-        virtual_chapter_c * p_vchap = chapters[i];
+        virtual_chapter_c * p_vchap = vchapters[i];
 
         p_vchap->i_mk_virtual_start_time = i_duration;
         i_duration += p_vchap->segment.i_duration * 1000;
@@ -265,8 +265,8 @@ virtual_segment_c::virtual_segment_c( matroska_segment_c & main_segment, std::ve
     /* Main segment */
     std::vector<chapter_edition_c*>::size_type i;
     i_sys_title = 0;
-    p_current_chapter = NULL;
-    b_current_chapter_entered = false;
+    p_current_vchapter = NULL;
+    b_current_vchapter_entered = false;
 
     i_current_edition = main_segment.i_default_edition;
 
@@ -292,33 +292,33 @@ virtual_segment_c::virtual_segment_c( matroska_segment_c & main_segment, std::ve
             delete p_vedition;
         }
         else
-            editions.push_back( p_vedition );
+            veditions.push_back( p_vedition );
     }
     /*if we don't have edition create a dummy one*/
     if( !main_segment.stored_editions.size() )
     {
         virtual_edition_c * p_vedition = new virtual_edition_c( NULL, main_segment, p_opened_segments );
-        editions.push_back( p_vedition );
+        veditions.push_back( p_vedition );
     }
 
     /* Get the default edition, if there is none, use the first one */
-    for( i = 0; i < editions.size(); i++)
+    for( i = 0; i < veditions.size(); i++)
     {
-        if( editions[i]->p_edition && editions[i]->p_edition->b_default )
+        if( veditions[i]->p_edition && veditions[i]->p_edition->b_default )
         {
             i_current_edition = i;
             break;
         }
     }
     /* Set current chapter */
-    p_current_chapter = editions[i_current_edition]->getChapterbyTimecode(0);
+    p_current_vchapter = veditions[i_current_edition]->getChapterbyTimecode(0);
 
 }
 
 virtual_segment_c::~virtual_segment_c()
 {
-    for( size_t i = 0; i < editions.size(); i++ )
-        delete editions[i];
+    for( size_t i = 0; i < veditions.size(); i++ )
+        delete veditions[i];
 }
 
 virtual_chapter_c *virtual_segment_c::BrowseCodecPrivate( unsigned int codec_id,
@@ -342,9 +342,9 @@ virtual_chapter_c * virtual_edition_c::BrowseCodecPrivate( unsigned int codec_id
     if( !p_edition )
         return NULL;
 
-    for( size_t i = 0; i < chapters.size(); i++ )
+    for( size_t i = 0; i < vchapters.size(); i++ )
     {
-        virtual_chapter_c * p_result = chapters[i]->BrowseCodecPrivate( codec_id, match, p_cookie, i_cookie_size );
+        virtual_chapter_c * p_result = vchapters[i]->BrowseCodecPrivate( codec_id, match, p_cookie, i_cookie_size );
         if( p_result )
             return p_result;
     }
@@ -364,9 +364,9 @@ virtual_chapter_c * virtual_chapter_c::BrowseCodecPrivate( unsigned int codec_id
     if( p_chapter->BrowseCodecPrivate( codec_id, match, p_cookie, i_cookie_size ) )
         return this;
 
-    for( size_t i = 0; i < sub_chapters.size(); i++ )
+    for( size_t i = 0; i < sub_vchapters.size(); i++ )
     {
-        virtual_chapter_c * p_result = sub_chapters[i]->BrowseCodecPrivate( codec_id, match, p_cookie, i_cookie_size );
+        virtual_chapter_c * p_result = sub_vchapters[i]->BrowseCodecPrivate( codec_id, match, p_cookie, i_cookie_size );
         if( p_result )
             return p_result;
     }
@@ -375,10 +375,10 @@ virtual_chapter_c * virtual_chapter_c::BrowseCodecPrivate( unsigned int codec_id
 
 virtual_chapter_c* virtual_chapter_c::getSubChapterbyTimecode( int64_t time )
 {
-    for( size_t i = 0; i < sub_chapters.size(); i++ )
+    for( size_t i = 0; i < sub_vchapters.size(); i++ )
     {
-        if( time >= sub_chapters[i]->i_mk_virtual_start_time && time < sub_chapters[i]->i_mk_virtual_stop_time )
-            return sub_chapters[i]->getSubChapterbyTimecode( time );
+        if( time >= sub_vchapters[i]->i_mk_virtual_start_time && time < sub_vchapters[i]->i_mk_virtual_stop_time )
+            return sub_vchapters[i]->getSubChapterbyTimecode( time );
     }
 
     return this;
@@ -386,18 +386,18 @@ virtual_chapter_c* virtual_chapter_c::getSubChapterbyTimecode( int64_t time )
 
 virtual_chapter_c* virtual_edition_c::getChapterbyTimecode( int64_t time )
 {
-    for( size_t i = 0; i < chapters.size(); i++ )
+    for( size_t i = 0; i < vchapters.size(); i++ )
     {
-        if( time >= chapters[i]->i_mk_virtual_start_time &&
-            ( chapters[i]->i_mk_virtual_stop_time < 0 || time < chapters[i]->i_mk_virtual_stop_time ) )
+        if( time >= vchapters[i]->i_mk_virtual_start_time &&
+            ( vchapters[i]->i_mk_virtual_stop_time < 0 || time < vchapters[i]->i_mk_virtual_stop_time ) )
             /*with the current implementation only the last chapter can have a negative virtual_stop_time*/
-            return chapters[i]->getSubChapterbyTimecode( time );
+            return vchapters[i]->getSubChapterbyTimecode( time );
     }
 
     /* special case for the beggining of the first ordered chapter */
-    if ( time == 0 && b_ordered && chapters.size() )
+    if ( time == 0 && b_ordered && vchapters.size() )
     {
-        return chapters[0]->getSubChapterbyTimecode( time );
+        return vchapters[0]->getSubChapterbyTimecode( time );
     }
 
     return NULL;
@@ -406,65 +406,65 @@ virtual_chapter_c* virtual_edition_c::getChapterbyTimecode( int64_t time )
 bool virtual_segment_c::UpdateCurrentToChapter( demux_t & demux )
 {
     demux_sys_t & sys = *demux.p_sys;
-    virtual_chapter_c *p_cur_chapter = NULL;
-    virtual_edition_c * p_cur_edition = editions[ i_current_edition ];
+    virtual_chapter_c *p_cur_vchapter = NULL;
+    virtual_edition_c *p_cur_vedition = veditions[ i_current_edition ];
 
     bool b_has_seeked = false;
 
-    if ( !b_current_chapter_entered && p_current_chapter != NULL )
+    if ( !b_current_vchapter_entered && p_current_vchapter != NULL )
     {
-        p_current_chapter->Enter( true );
-        b_current_chapter_entered = true;
+        p_current_vchapter->Enter( true );
+        b_current_vchapter_entered = true;
     }
 
     if ( sys.i_pts != VLC_TS_INVALID )
-        p_cur_chapter = p_cur_edition->getChapterbyTimecode( sys.i_pts - VLC_TS_0 );
+        p_cur_vchapter = p_cur_vedition->getChapterbyTimecode( sys.i_pts - VLC_TS_0 );
 
     /* we have moved to a new chapter */
-    if ( p_cur_chapter != NULL && p_current_chapter != p_cur_chapter )
+    if ( p_cur_vchapter != NULL && p_current_vchapter != p_cur_vchapter )
         {
             msg_Dbg( &demux, "NEW CHAPTER %" PRId64, sys.i_pts );
-            if ( p_cur_edition->b_ordered )
+            if ( p_cur_vedition->b_ordered )
             {
                 /* FIXME EnterAndLeave has probably been broken for a long time */
                 // Leave/Enter up to the link point
-                b_has_seeked = p_cur_chapter->EnterAndLeave( p_current_chapter );
+                b_has_seeked = p_cur_vchapter->EnterAndLeave( p_current_vchapter );
                 if ( !b_has_seeked )
                 {
                     // only physically seek if necessary
-                    if ( p_current_chapter == NULL ||
-                        ( p_current_chapter && &p_current_chapter->segment != &p_cur_chapter->segment ) ||
-                        ( p_current_chapter->p_chapter->i_end_time != p_cur_chapter->p_chapter->i_start_time ))
+                    if ( p_current_vchapter == NULL ||
+                        ( p_current_vchapter && &p_current_vchapter->segment != &p_cur_vchapter->segment ) ||
+                        ( p_current_vchapter->p_chapter->i_end_time != p_cur_vchapter->p_chapter->i_start_time ))
                     {
                         /* Forcing reset pcr */
                         es_out_Control( demux.out, ES_OUT_RESET_PCR);
-                        Seek( demux, p_cur_chapter->i_mk_virtual_start_time, p_cur_chapter, -1 );
+                        Seek( demux, p_cur_vchapter->i_mk_virtual_start_time, p_cur_vchapter, -1 );
                         return true;
                     }
                 }
-                sys.i_start_pts = p_cur_chapter->i_mk_virtual_start_time + VLC_TS_0;
+                sys.i_start_pts = p_cur_vchapter->i_mk_virtual_start_time + VLC_TS_0;
             }
 
-            p_current_chapter = p_cur_chapter;
-            if ( p_cur_chapter->i_seekpoint_num > 0 )
+            p_current_vchapter = p_cur_vchapter;
+            if ( p_cur_vchapter->i_seekpoint_num > 0 )
             {
                 demux.info.i_update |= INPUT_UPDATE_TITLE | INPUT_UPDATE_SEEKPOINT;
                 demux.info.i_title = sys.i_current_title = i_sys_title;
-                demux.info.i_seekpoint = p_cur_chapter->i_seekpoint_num - 1;
+                demux.info.i_seekpoint = p_cur_vchapter->i_seekpoint_num - 1;
             }
 
             return b_has_seeked;
         }
-        else if ( p_cur_chapter == NULL )
+        else if ( p_cur_vchapter == NULL )
         {
             /* out of the scope of the data described by chapters, leave the edition */
-            if ( p_cur_edition->b_ordered && p_current_chapter != NULL )
+            if ( p_cur_vedition->b_ordered && p_current_vchapter != NULL )
             {
                 /* TODO */
-                if ( !p_cur_edition->p_edition->EnterAndLeave( p_current_chapter->p_chapter, false ) )
+                if ( !p_cur_vedition->p_edition->EnterAndLeave( p_current_vchapter->p_chapter, false ) )
                 {
-                    p_current_chapter = NULL;
-                    b_current_chapter_entered = false;
+                    p_current_vchapter = NULL;
+                    b_current_vchapter_entered = false;
                 }
                 else
                     return true;
@@ -482,31 +482,31 @@ bool virtual_chapter_c::EnterAndLeave( virtual_chapter_c *p_item, bool b_enter )
 }
 
 void virtual_segment_c::Seek( demux_t & demuxer, mtime_t i_mk_date,
-                              virtual_chapter_c *p_chapter, int64_t i_global_position )
+                              virtual_chapter_c *p_vchapter, int64_t i_global_position )
 {
     demux_sys_t *p_sys = demuxer.p_sys;
 
 
     /* find the actual time for an ordered edition */
-    if ( p_chapter == NULL )
+    if ( p_vchapter == NULL )
         /* 1st, we need to know in which chapter we are */
-        p_chapter = editions[ i_current_edition ]->getChapterbyTimecode( i_mk_date );
+        p_vchapter = veditions[ i_current_edition ]->getChapterbyTimecode( i_mk_date );
 
-    if ( p_chapter != NULL )
+    if ( p_vchapter != NULL )
     {
-        mtime_t i_mk_time_offset = p_chapter->i_mk_virtual_start_time - ( ( p_chapter->p_chapter )? p_chapter->p_chapter->i_start_time : 0 );
-        p_sys->i_mk_chapter_time = i_mk_time_offset - p_chapter->segment.i_mk_start_time;
-        if ( p_chapter->p_chapter && p_chapter->i_seekpoint_num > 0 )
+        mtime_t i_mk_time_offset = p_vchapter->i_mk_virtual_start_time - ( ( p_vchapter->p_chapter )? p_vchapter->p_chapter->i_start_time : 0 );
+        p_sys->i_mk_chapter_time = i_mk_time_offset - p_vchapter->segment.i_mk_start_time /* + VLC_TS_0 */;
+        if ( p_vchapter->p_chapter && p_vchapter->i_seekpoint_num > 0 )
         {
             demuxer.info.i_update |= INPUT_UPDATE_TITLE | INPUT_UPDATE_SEEKPOINT;
             demuxer.info.i_title = p_sys->i_current_title = i_sys_title;
-            demuxer.info.i_seekpoint = p_chapter->i_seekpoint_num - 1;
+            demuxer.info.i_seekpoint = p_vchapter->i_seekpoint_num - 1;
         }
 
-        if( &p_current_chapter->segment != &p_chapter->segment )
-            ChangeSegment( p_current_chapter->segment, p_chapter->segment, i_mk_date );
-        p_current_chapter = p_chapter;
-        p_chapter->segment.Seek( i_mk_date, i_mk_time_offset, i_global_position );
+        if( &p_current_vchapter->segment != &p_vchapter->segment )
+            ChangeSegment( p_current_vchapter->segment, p_vchapter->segment, i_mk_date );
+        p_current_vchapter = p_vchapter;
+        p_vchapter->segment.Seek( i_mk_date, i_mk_time_offset, i_global_position );
     }
 }
 
@@ -515,9 +515,9 @@ virtual_chapter_c * virtual_chapter_c::FindChapter( int64_t i_find_uid )
     if( p_chapter && ( p_chapter->i_uid == i_find_uid ) )
         return this;
 
-    for( size_t i = 0; i < sub_chapters.size(); i++ )
+    for( size_t i = 0; i < sub_vchapters.size(); i++ )
     {
-        virtual_chapter_c * p_res = sub_chapters[i]->FindChapter( i_find_uid );
+        virtual_chapter_c * p_res = sub_vchapters[i]->FindChapter( i_find_uid );
         if( p_res )
             return p_res;
     }
@@ -527,11 +527,11 @@ virtual_chapter_c * virtual_chapter_c::FindChapter( int64_t i_find_uid )
 
 virtual_chapter_c * virtual_segment_c::FindChapter( int64_t i_find_uid )
 {
-    virtual_edition_c * p_edition = editions[i_current_edition];
+    virtual_edition_c * p_edition = veditions[i_current_edition];
 
-    for( size_t i = 0; p_edition->chapters.size(); i++ )
+    for( size_t i = 0; p_edition->vchapters.size(); i++ )
     {
-        virtual_chapter_c * p_chapter = p_edition->chapters[i]->FindChapter( i_find_uid );
+        virtual_chapter_c * p_chapter = p_edition->vchapters[i]->FindChapter( i_find_uid );
         if( p_chapter )
             return p_chapter;
     }
@@ -548,8 +548,8 @@ int virtual_chapter_c::PublishChapters( input_title_t & title, int & i_user_chap
     }
 
     if ( ( p_chapter && p_chapter->b_display_seekpoint &&
-         ( ( sub_chapters.size() > 0 && i_mk_virtual_start_time != sub_chapters[0]->i_mk_virtual_start_time) ||
-           sub_chapters.size() == 0 ) ) || !p_chapter )
+         ( ( sub_vchapters.size() > 0 && i_mk_virtual_start_time != sub_vchapters[0]->i_mk_virtual_start_time) ||
+           sub_vchapters.size() == 0 ) ) || !p_chapter )
     {
         seekpoint_t *sk = vlc_seekpoint_New();
 
@@ -570,8 +570,8 @@ int virtual_chapter_c::PublishChapters( input_title_t & title, int & i_user_chap
     }
     i_seekpoint_num = i_user_chapters;
 
-    for( size_t i = 0; i < sub_chapters.size(); i++ )
-        sub_chapters[i]->PublishChapters( title, i_user_chapters, i_level + 1 );
+    for( size_t i = 0; i < sub_vchapters.size(); i++ )
+        sub_vchapters[i]->PublishChapters( title, i_user_chapters, i_level + 1 );
 
     return i_user_chapters;
 }
@@ -581,8 +581,8 @@ int virtual_edition_c::PublishChapters( input_title_t & title, int & i_user_chap
 {
 
     /* HACK for now don't expose edition as a seekpoint if its start time is the same than it's first chapter */
-    if( chapters.size() > 0 &&
-        chapters[0]->i_mk_virtual_start_time && p_edition )
+    if( vchapters.size() > 0 &&
+        vchapters[0]->i_mk_virtual_start_time && p_edition )
     {
         seekpoint_t *sk = vlc_seekpoint_New();
 
@@ -600,8 +600,8 @@ int virtual_edition_c::PublishChapters( input_title_t & title, int & i_user_chap
     }
 
 //    if( chapters.size() > 1 )
-        for( size_t i = 0; i < chapters.size(); i++ )
-            chapters[i]->PublishChapters( title, i_user_chapters, i_level );
+        for( size_t i = 0; i < vchapters.size(); i++ )
+            vchapters[i]->PublishChapters( title, i_user_chapters, i_level );
 
     return i_user_chapters;
 }
diff --git a/modules/demux/mkv/virtual_segment.hpp b/modules/demux/mkv/virtual_segment.hpp
index 7b943a1..3e1232f 100644
--- a/modules/demux/mkv/virtual_segment.hpp
+++ b/modules/demux/mkv/virtual_segment.hpp
@@ -39,7 +39,7 @@ public:
     virtual_chapter_c( matroska_segment_c &seg, chapter_item_c *p_chap, int64_t start, int64_t stop, std::vector<virtual_chapter_c *> & sub_chaps ):
         segment(seg), p_chapter(p_chap),
         i_mk_virtual_start_time(start), i_mk_virtual_stop_time(stop),
-        sub_chapters(sub_chaps)
+        sub_vchapters(sub_chaps)
     {}
     ~virtual_chapter_c();
 
@@ -72,7 +72,7 @@ public:
     mtime_t             i_mk_virtual_start_time;
     mtime_t             i_mk_virtual_stop_time;
     int                 i_seekpoint_num;
-    std::vector<virtual_chapter_c *> sub_chapters;
+    std::vector<virtual_chapter_c *> sub_vchapters;
 #ifdef MKV_DEBUG
     void print();
 #endif
@@ -83,7 +83,7 @@ class virtual_edition_c
 public:
     virtual_edition_c( chapter_edition_c * p_edition, matroska_segment_c & main_segment, std::vector<matroska_segment_c*> & opened_segments );
     ~virtual_edition_c();
-    std::vector<virtual_chapter_c*> chapters;
+    std::vector<virtual_chapter_c*> vchapters;
 
     virtual_chapter_c* getChapterbyTimecode( int64_t time );
     std::string GetMainName();
@@ -114,38 +114,38 @@ class virtual_segment_c
 public:
     virtual_segment_c( matroska_segment_c & segment, std::vector<matroska_segment_c*> & opened_segments );
     ~virtual_segment_c();
-    std::vector<virtual_edition_c*> editions;
+    std::vector<virtual_edition_c*> veditions;
     std::vector<virtual_edition_c*>::size_type i_current_edition;
-    virtual_chapter_c               *p_current_chapter;
-    bool                            b_current_chapter_entered;
+    virtual_chapter_c               *p_current_vchapter;
+    bool                            b_current_vchapter_entered;
     int                             i_sys_title;
 
 
     inline virtual_edition_c * CurrentEdition()
     {
-        if( i_current_edition < editions.size() )
-            return editions[i_current_edition];
+        if( i_current_edition < veditions.size() )
+            return veditions[i_current_edition];
         return NULL;
     }
 
     virtual_chapter_c * CurrentChapter() const
     {
-        return p_current_chapter;
+        return p_current_vchapter;
     }
 
     matroska_segment_c * CurrentSegment() const
     {
-        if ( !p_current_chapter )
+        if ( !p_current_vchapter )
             return NULL;
-        return &p_current_chapter->segment;
+        return &p_current_vchapter->segment;
     }
 
     inline int64_t Duration()
     {
-        return editions[i_current_edition]->i_duration / 1000;
+        return veditions[i_current_edition]->i_duration / 1000;
     }
 
-    inline std::vector<virtual_edition_c*>* Editions() { return &editions; }
+    inline std::vector<virtual_edition_c*>* Editions() { return &veditions; }
 
     virtual_chapter_c *BrowseCodecPrivate( unsigned int codec_id,
                                            bool (*match)( const chapter_codec_cmds_c &data,
@@ -158,7 +158,7 @@ public:
 
     bool UpdateCurrentToChapter( demux_t & demux );
     void Seek( demux_t & demuxer, mtime_t i_mk_date,
-               virtual_chapter_c *p_chapter, int64_t i_global_position );
+               virtual_chapter_c *p_vchapter, int64_t i_global_position );
 private:
     void ChangeSegment( matroska_segment_c & p_old, matroska_segment_c & p_new, mtime_t i_mk_start_time );
 };
-- 
2.7.2.windows.1




More information about the vlc-devel mailing list