[vlc-devel] [PATCH 0/2] mkv: Introducing a StringDispatcher

Filip Roséen filip at videolabs.io
Wed Mar 9 12:33:19 CET 2016


These two patches are related to a new helper class named StringDispatcher that
will make it easier to maintain previous usage of massive if-else trees
containing far too many "strcmp" and "strncmp".

I think the code in patch #2 speaks for itself when it comes to usage, and the
StringDispatcher is built on top of dispatcher.hpp: 

    - https://mailman.videolan.org/pipermail/vlc-devel/2016-March/106560.html
    - https://mailman.videolan.org/pipermail/vlc-devel/2016-March/106556.html

Filip Roséen (2):
  mkv: Added StringDispatcher (including changes to Makefile.am)
  mkv: Use `StringDispatcher` in `matroska_segment_c::TrackInit`

 modules/demux/Makefile.am                    |   1 +
 modules/demux/mkv/matroska_segment_parse.cpp | 987 +++++++++++++--------------
 modules/demux/mkv/string_dispatcher.hpp      | 175 +++++
 3 files changed, 669 insertions(+), 494 deletions(-)
 create mode 100644 modules/demux/mkv/string_dispatcher.hpp

-- 
2.7.2



More information about the vlc-devel mailing list