[vlc-commits] mkv: simplify the code

Steve Lhomme git at videolan.org
Tue Mar 15 10:41:20 CET 2016


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Tue Mar 15 08:50:25 2016 +0100| [b05660b8783d1b85442b93414c36ee9b3199fa7f] | committer: Jean-Baptiste Kempf

mkv: simplify the code

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/mkv/demux.cpp |   10 +---------
 modules/demux/mkv/demux.hpp |    3 ---
 2 files changed, 1 insertion(+), 12 deletions(-)

diff --git a/modules/demux/mkv/demux.cpp b/modules/demux/mkv/demux.cpp
index 5018439..3c0aba5 100644
--- a/modules/demux/mkv/demux.cpp
+++ b/modules/demux/mkv/demux.cpp
@@ -654,7 +654,7 @@ bool demux_sys_t::PreloadLinked()
     size_t i, j, ij = 0;
     virtual_segment_c *p_seg;
 
-    p_current_segment = VirtualFromSegments( &opened_segments );
+    p_current_segment = opened_segments.size() ? new (std::nothrow) virtual_segment_c( opened_segments ) : NULL;
     if ( !p_current_segment )
         return false;
 
@@ -757,14 +757,6 @@ void demux_sys_t::FreeUnused()
     }
 }
 
-virtual_segment_c *demux_sys_t::VirtualFromSegments( std::vector<matroska_segment_c*> *p_segments ) const
-{
-    if ( p_segments->empty() )
-        return NULL;
-    virtual_segment_c *p_result = new virtual_segment_c( *p_segments );
-    return p_result;
-}
-
 bool demux_sys_t::PreparePlayback( virtual_segment_c *p_new_segment )
 {
     if ( p_new_segment != NULL && p_new_segment != p_current_segment )
diff --git a/modules/demux/mkv/demux.hpp b/modules/demux/mkv/demux.hpp
index 49c1c22..9310e11 100644
--- a/modules/demux/mkv/demux.hpp
+++ b/modules/demux/mkv/demux.hpp
@@ -397,9 +397,6 @@ public:
 
     /* event */
     event_thread_t *p_ev;
-
-protected:
-    virtual_segment_c *VirtualFromSegments( std::vector<matroska_segment_c*> *p_segments ) const;
 };
 
 



More information about the vlc-commits mailing list