[vlc-devel] [PATCH 00/20] initial cleanup of demux/mkv (take #2)

Filip Roséen filip at videolabs.io
Fri Mar 4 17:03:58 CET 2016


These are the initial patches for the mkv demuxer, without the contriversal
additions of EbmlTypeDispatcher and StringDispatcher.

Issues fixed
-------------------------------------------------------------------------------

During the review of the previous patch-batch, *Hugo Beauzée-Luyseen* noticed a
few issues which have been fixed in this one.

  - Fixed Off-by-one error in patch #12
  - Removed unused variable in patch #16

Replacement of casts
-------------------------------------------------------------------------------

There are some new patches in this batch that boils down to replacing the
c-style casts with C++ casts. This was mostly applied because I got bitten by a
commit where I had changed the name of a variable, but forgot to do it in one
place.

The variable was named `ctime`, and was used in a context like `(uint32)ctime`,
effectively meaning that the function "ctime" from <time.h> was converted into
`uint32`; something which would have been caught at compile time with
`static_cast<uint32>( ctime )`.

Bitten in the ass by my own karma; I was going to do the replacements "later"
(meaning "kinda never"), but here they are because of the above.

Thanks!

Filip Roséen (20):
  mkv: added warning regarding undefined-behavior
  mkv: cleaned `chapters.{cpp,hpp}`
  mkv: replaced magic `10` by real constant + fixed initialization
  mkv: matroska_segment.cpp c-style cast => c++ cast
  mkv: matroska_segment_parse.cpp c-style cast => c++ cast
  mkv: chapter_command.cpp c-style casts => c++ casts
  mkv: mkv.cpp c-style casts => c++ casts (+fix)
  mkv: util.cpp c-style casts => c++ casts
  mkv: virtual_segment.cpp c-style casts => c++ casts
  mkv: stream_io_callback.cpp c-style casts => c++ casts
  mkv: removed indirection when initializing std::string
  mkv: replaced manual memory-management with `std::vector` in `matroska_segment_c`
  mkv: Introduced MKV_CHECKED_PTR_DECL
  mkv: `MKV_CHECKED_PTR_DECL` introduced to `matroska_segment.cpp`
  mkv: removed unnecessary dynamic memory allocations
  mkv: removed manual memory management from Tags + SimpleTags
  mkv: replaced (manual) linked-list with std::vector in `matroska_segment_c::Seek`
  mkv: Added error diagnostic if i_track does not match seekpoint
  mkv: removed unnecessary memory-allocation in `matroska_segment_parse.cpp`
  mkv: Reimplemented MkvTree and moved it to `Util.hpp`

 modules/demux/mkv/Ebml_parser.cpp            |   8 +-
 modules/demux/mkv/Ebml_parser.hpp            |   4 +-
 modules/demux/mkv/chapter_command.cpp        |  23 +-
 modules/demux/mkv/chapters.cpp               |  70 ++--
 modules/demux/mkv/chapters.hpp               |   3 +
 modules/demux/mkv/demux.cpp                  |  14 +-
 modules/demux/mkv/matroska_segment.cpp       | 600 +++++++++++----------------
 modules/demux/mkv/matroska_segment.hpp       |  35 +-
 modules/demux/mkv/matroska_segment_parse.cpp | 301 ++++++--------
 modules/demux/mkv/mkv.cpp                    |  62 +--
 modules/demux/mkv/mkv.hpp                    |   1 +
 modules/demux/mkv/stream_io_callback.cpp     |   2 +-
 modules/demux/mkv/util.cpp                   |  56 ++-
 modules/demux/mkv/util.hpp                   |   4 +
 modules/demux/mkv/virtual_segment.cpp        |   4 +-
 15 files changed, 549 insertions(+), 638 deletions(-)

-- 
2.7.2



More information about the vlc-devel mailing list