vlc | branch: master | Rémi Denis-Courmont <r...@remlab.net> | Sun Dec  3 
12:14:15 2017 +0200| [db33e6a2ed90aaa1989ee471d08742597f35e1e7] | committer: 
Rémi Denis-Courmont

mkv: add DEMUX_GET_(TITLE|SEEKPOINT)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=db33e6a2ed90aaa1989ee471d08742597f35e1e7
---

 modules/demux/mkv/demux.hpp           |  2 ++
 modules/demux/mkv/mkv.cpp             | 13 ++++++++++---
 modules/demux/mkv/virtual_segment.cpp |  8 ++++----
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/modules/demux/mkv/demux.hpp b/modules/demux/mkv/demux.hpp
index f5b0b0d9db..1d6c3d5bf5 100644
--- a/modules/demux/mkv/demux.hpp
+++ b/modules/demux/mkv/demux.hpp
@@ -337,6 +337,7 @@ public:
         ,i_mk_chapter_time(0)
         ,meta(NULL)
         ,i_current_title(0)
+        ,i_current_seekpoint(0)
         ,p_current_vsegment(NULL)
         ,dvd_interpretor( *this )
         ,f_duration(-1.0)
@@ -360,6 +361,7 @@ public:
 
     std::vector<input_title_t*>      titles; // matroska editions
     size_t                           i_current_title;
+    size_t                           i_current_seekpoint;
 
     std::vector<matroska_stream_c*>  streams;
     std::vector<attachment_c*>       stored_attachments;
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index 3a8a0baaae..95d4308ab3 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -394,8 +394,7 @@ static int Control( demux_t *p_demux, int i_query, va_list 
args )
                     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;
-                    p_demux->info.i_seekpoint = 0;
-                    p_demux->info.i_title = i_idx;
+                    p_sys->i_current_seekpoint = 0;
                     p_sys->f_duration = (float) p_sys->titles[i_idx]->i_length 
/ 1000.f;
                     return VLC_SUCCESS;
                 }
@@ -417,12 +416,20 @@ static int Control( demux_t *p_demux, int i_query, 
va_list args )
                 if( i_ret == VLC_SUCCESS )
                 {
                     p_demux->info.i_update |= INPUT_UPDATE_SEEKPOINT;
-                    p_demux->info.i_seekpoint = i_skp;
+                    p_sys->i_current_seekpoint = i_skp;
                 }
                 return i_ret;
             }
             return VLC_EGENERIC;
 
+        case DEMUX_GET_TITLE:
+            *va_arg( args, int * ) = p_sys->i_current_title;
+            return VLC_SUCCESS;
+
+        case DEMUX_GET_SEEKPOINT:
+            *va_arg( args, int * ) = p_sys->i_current_seekpoint;
+            return VLC_SUCCESS;
+
         case DEMUX_GET_FPS:
             pf = va_arg( args, double * );
             *pf = 0.0;
diff --git a/modules/demux/mkv/virtual_segment.cpp 
b/modules/demux/mkv/virtual_segment.cpp
index a3b2e34127..eea846ffd5 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -474,8 +474,8 @@ bool virtual_segment_c::UpdateCurrentToChapter( demux_t & 
demux )
             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_vchapter->i_seekpoint_num - 1;
+                sys.i_current_title = i_sys_title;
+                sys.i_current_seekpoint = p_cur_vchapter->i_seekpoint_num - 1;
             }
 
             return b_has_seeked;
@@ -531,8 +531,8 @@ bool virtual_segment_c::Seek( demux_t & demuxer, mtime_t 
i_mk_date,
         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_vchapter->i_seekpoint_num - 1;
+            p_sys->i_current_title = i_sys_title;
+            p_sys->i_current_seekpoint = p_vchapter->i_seekpoint_num - 1;
         }
 
         if( p_current_vchapter == NULL || &p_current_vchapter->segment != 
&p_vchapter->segment )

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to