[vlc-commits] demux: mkv: demux_sys_t::p_ev does not need dynamic lifetime

Filip Roséen git at videolan.org
Fri Jul 20 09:37:37 CEST 2018


vlc | branch: master | Filip Roséen <filip at atch.se> | Wed Jul 18 06:53:02 2018 +0200| [22ad6b519256abe810ac96e85a52500000b2433b] | committer: Thomas Guillem

demux: mkv: demux_sys_t::p_ev does not need dynamic lifetime

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

 modules/demux/mkv/demux.cpp            | 6 ------
 modules/demux/mkv/demux.hpp            | 4 ++--
 modules/demux/mkv/matroska_segment.cpp | 2 +-
 modules/demux/mkv/mkv.cpp              | 2 +-
 4 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/modules/demux/mkv/demux.cpp b/modules/demux/mkv/demux.cpp
index ab7a4c044f..e8cad67162 100644
--- a/modules/demux/mkv/demux.cpp
+++ b/modules/demux/mkv/demux.cpp
@@ -173,16 +173,10 @@ void demux_sys_t::InitUi()
         var_Create( p_input, "menu-palette", VLC_VAR_ADDRESS );
         var_Create( p_input, "highlight", VLC_VAR_BOOL );
     }
-
-    /* Now create our event thread catcher */
-    p_ev = new event_thread_t(&demuxer);
 }
 
 void demux_sys_t::CleanUi()
 {
-    delete p_ev;
-    p_ev = NULL;
-
     if( p_input )
     {
         var_Destroy( p_input, "highlight" );
diff --git a/modules/demux/mkv/demux.hpp b/modules/demux/mkv/demux.hpp
index 343f3124d7..ba0f6b6d89 100644
--- a/modules/demux/mkv/demux.hpp
+++ b/modules/demux/mkv/demux.hpp
@@ -56,7 +56,7 @@ public:
         ,dvd_interpretor( *this )
         ,f_duration(-1.0)
         ,p_input(NULL)
-        ,p_ev(NULL)
+        ,ev(&demux)
     {
         vlc_mutex_init( &lock_demuxer );
     }
@@ -115,7 +115,7 @@ public:
     vlc_mutex_t    lock_demuxer;
 
     /* event */
-    event_thread_t *p_ev;
+    event_thread_t ev;
 };
 
 } // namespace
diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index 057d992d23..c8ce568a81 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -1148,7 +1148,7 @@ bool matroska_segment_c::ESCreate()
 
 void matroska_segment_c::ESDestroy( )
 {
-    sys.p_ev->ResetPci();
+    sys.ev.ResetPci();
 
     for( tracks_map_t::iterator it = tracks.begin(); it != tracks.end(); ++it )
     {
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index c259ea630f..2ddff0368e 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -659,7 +659,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
             if ( track.fmt.i_cat == DATA_ES )
             {
                 // TODO handle the start/stop times of this packet
-                p_sys->p_ev->SetPci( (const pci_t *)&p_block->p_buffer[1]);
+                p_sys->ev.SetPci( (const pci_t *)&p_block->p_buffer[1]);
                 block_Release( p_block );
                 return;
             }



More information about the vlc-commits mailing list