[vlc-commits] demux:mkv: simplify the parser dispatcher code

Steve Lhomme git at videolan.org
Fri Jan 19 16:07:18 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jan 19 09:53:05 2018 +0100| [c513b7b9b50c7a92ac3b1e20cedf80b8f6ea3833] | committer: Jean-Baptiste Kempf

demux:mkv: simplify the parser dispatcher code

Should fix #19190

(cherry picked from commit dfa53d0967ec8ccf157c2de4a684a038a376100f)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/mkv/dispatcher.hpp | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/modules/demux/mkv/dispatcher.hpp b/modules/demux/mkv/dispatcher.hpp
index 37a94479ae..9b4e3e696b 100644
--- a/modules/demux/mkv/dispatcher.hpp
+++ b/modules/demux/mkv/dispatcher.hpp
@@ -57,17 +57,17 @@ namespace {
   template<int>
   struct DispatcherTag;
 
-  template<class T, T*, class DispatcherType>
+  template<class T, class DispatcherType>
   class DispatchContainer {
     public:    static DispatcherType dispatcher;
     protected: static vlc_mutex_t   _dispatcher_lock;
   };
 
-  template<class T, T* P, class DT>
-  DT DispatchContainer<T, P, DT>::dispatcher;
+  template<class T, class DT>
+  DT DispatchContainer<T, DT>::dispatcher;
 
-  template<class T, T* P, class DT>
-  vlc_mutex_t DispatchContainer<T, P, DT>::_dispatcher_lock = VLC_STATIC_MUTEX;
+  template<class T, class DT>
+  vlc_mutex_t DispatchContainer<T, DT>::_dispatcher_lock = VLC_STATIC_MUTEX;
 }
 
 // ----------------------------------------------------------------------------
@@ -89,9 +89,8 @@ namespace {
 
 #define MKV_SWITCH_CREATE(DispatchType_, GroupName_, PayloadType_) \
   typedef DispatcherTag<__LINE__> GroupName_ ## _tag_t; \
-  extern GroupName_##_tag_t GroupName_ ## _tag; \
   struct GroupName_; \
-  struct GroupName_##_base : DispatchContainer<GroupName_##_tag_t, &GroupName_##_tag, DispatchType_> { \
+  struct GroupName_##_base : DispatchContainer<GroupName_##_tag_t, DispatchType_> { \
       typedef      PayloadType_ payload_t;                         \
       typedef     DispatchType_ dispatch_t;                        \
       typedef struct GroupName_ handler_t;                         \



More information about the vlc-commits mailing list