Commit c513b7b9 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

demux:mkv: simplify the parser dispatcher code

Should fix #19190

(cherry picked from commit dfa53d09)
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 8b85798d
......@@ -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; \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment