Commit Graph

86 Commits

Author SHA1 Message Date
Martchus 909a3ee98a Improve comments in Matroska container code 2023-10-31 21:27:17 +01:00
Martchus 56ccd3da80 Use auto-syntax in places touched by previous commit consistently 2023-10-31 20:06:38 +01:00
Martchus 9f41c30443 Silence/fix GCC's maybe-uninitialized warnings
* The warning about `bsEnvCount` is actually correct.
* The warning about `lastAtomToBeWritten` might be correct.
* The warning about `relPos` is definitely unjustified because `relPos` is
  only used when `cueRelativePositionElement` is not `nullptr` and `relPos`
  is initialized in that case.
* The warnings about `pos`, `nextPageOffset` and `startOfLastMetaDataBlock`
  are also wrong for similar reasons.
2023-10-31 20:05:13 +01:00
Martchus 04795f957f Fix setting writing app name after allowing to preserve it 2023-08-09 23:26:34 +02:00
Martchus c0e9f9bf83 Fix condition for preserving muxing/writing app 2023-08-09 23:17:26 +02:00
Martchus e6bb98d6e6 Improve dealing with muxing/writing application of Matroska files
* Allow reading the current muxing/writing application
* Allow to preserve the original muxing/writing application instead of
  always overriding
2023-08-08 17:18:02 +02:00
Martchus 5745632af7 Move `maxFullParseSize()` to `MediaFileInfo` as non-static member 2023-05-16 23:11:53 +02:00
Martchus 981db492e4 Avoid unqualified calls to `std::move` 2023-02-20 19:54:42 +01:00
Martchus cb93d6900c Apply clang-format 2023-02-03 13:31:40 +01:00
Martchus ca6abe31a0 Fix compilation with MSVC
Apparently the move c'tor isn't available unless explicitly specified
leading to errors when `SegmentData` is used in `std::vector`.
2023-02-02 00:28:01 +01:00
Martchus 205b119416 Use `std` more consistently in `matroskacontainer.cpp` 2023-02-02 00:24:49 +01:00
Martchus dc4e4082e0 Use `std::filesystem::resize_file` instead of POSIX function
* Avoid platform-specific code
* Fix build with MSVC
2023-02-01 14:05:32 +01:00
Martchus b740d2c1e0 Simplify code 2021-12-31 00:30:11 +01:00
Martchus e277070e9c Use `std::filesystem` in backup helper code
* Fix applying changes to symlinks so that the target is modified in any
  case (and not just if a rewrite isn't necessary)
* Avoid using `std::rename` and `std::remove` because they might not work
  under Windows when the path contains non-ASCII characters
* Simplify code, remove `isRelative()`
2021-09-11 23:54:49 +02:00
Martchus 5a1cb3d86f Add v11 FIXME to move MatroskaContainer::m_maxFullParseSize to MediaFileInfo 2021-08-25 19:04:51 +02:00
Martchus 14b4185023 Normalize known Matroska tag fields so they can be recognized despite different casing
* Do this by default with an opt-out; changing only known fields should not
  be very intrusive
* Fix recognizing known fields when only the case differs, see
  https://github.com/Martchus/tageditor/issues/72
2021-08-25 18:53:20 +02:00
Jonas Kvinge ea23d71e8a Fix spelling and typos 2021-07-02 11:12:39 +02:00
Martchus 0a041f6ad2 Fix warnings 2021-03-20 21:26:25 +01:00
Martchus 65597fd71e Add API to allow aborting overall/expensive parsing functions
* Not really implemented within the various code paths of the parsers at
  this point; this commit mainly adds the API.
* Adjust example in README
2021-02-04 23:21:50 +01:00
Martchus 709b4a409f Ensure attachments have been parsed before making MKV file 2021-02-01 17:10:29 +01:00
Martchus 64d98f5530 Use std::string_view where it makes sense 2021-01-30 21:53:06 +01:00
Martchus fb4633ad36 Add specific diag msg when abort saveing mkv while parsing orig file 2019-12-30 23:53:53 +01:00
Martchus b2c02e9acc Fix childs -> children 2019-12-30 22:54:11 +01:00
Martchus 7043c3d2a9 Don't suppress IO errors when writing files
* Close or flush streams explicitely so writing is not
  deferred
    * to catch errors in the right place
    * to avoid suppressing errors completely when writing
      would be deferred to the destructor invocation
* Improve comments
2019-12-15 19:43:16 +01:00
Martchus 480857b1b6 Parse "SeekHead" elements referenced by "Seek" elements
Follow at least one level of indirection by default
2019-06-17 19:11:00 +02:00
Martchus 5ad00a083c Adapt to changes in c++utilities 2019-06-10 23:11:39 +02:00
Martchus c17db5f2f6 Apply cmake-format and clang-format 2019-05-04 21:03:09 +02:00
Martchus 3288d49d62 Support 'file://' URLs also when saving 2019-05-04 16:04:37 +02:00
Martchus 7efa7a0d5a Adapt to c++utilities v5 2019-05-04 16:04:21 +02:00
Martchus a2ff0f418f Fix typo occured -> occurred 2018-07-23 14:44:06 +02:00
Martchus a87ad5f5ec Don't use global variable for backup directory 2018-07-12 12:34:38 +02:00
Martchus 3265e0bea4 Fix documentation which was still using the old namespace 2018-06-03 20:38:32 +02:00
Martchus 0a640c9f7f Fix warnings, mostly about implicit int conversions
This should fix all non-erros, leaving only warnings which
are indeed potential problems.

The following warnings should be safe to ignore:

* Conversions of various offsets from uint64 to
  std::streamoff/int64 are safe because such offsets have
  been obtained via tellg() and other functions
  returning std::streamoff in the first place.
* It also works vice-versa since tellg() should not
  return negative offsets with exceptions enabled.
* Conversions from char to unsigned char are also ok.
* Unused diag arguments can be ignored (those might be
  useful later).
* Annotate all intended fallthoughs.
2018-06-02 23:04:53 +02:00
Martchus cbb54d5aeb Allow custom writing application 2018-03-20 21:41:05 +01:00
Martchus c0336ed4bb Apply clang-format 2018-03-07 01:17:50 +01:00
Martchus efa67d6a1a Improve siblingById() and subelementByPath()
* Use 2 functions instead of flag parameter
* Support const correctness
2018-03-07 00:30:08 +01:00
Martchus 0e15c74103 Move everything into namespace TagParser 2018-03-06 23:09:15 +01:00
Martchus 36511fcc13 Add progress feedback and diagnostics replacing status provider 2018-03-06 22:44:01 +01:00
Martchus 7a02e8a325 Uniform/simplify typedefs in templates
* Begin type names with capital letter
* Remove typedefs for implementation type
* Remove useless/obsolete comments
* Simplify relevant code
2018-03-06 22:44:01 +01:00
Martchus b55d956b83 Fix some warnings 2018-02-05 14:51:21 +01:00
Martchus 6068bb09dc Improve coding style in determineElementPosition() 2018-02-05 00:59:34 +01:00
Martchus ae4e46869d Fix warning (signedness conversion) 2018-02-05 00:41:35 +01:00
Martchus 2c4b0abbea Use C++ random API 2018-02-05 00:40:11 +01:00
Martchus 74054e6e87 Fix default timecode scale in Matroska 2018-02-05 00:11:28 +01:00
Martchus e5c93e8293 Update 100 % percentage correctly 2017-10-30 08:21:17 +01:00
Martchus c9b961d6b4 Remove some TODOs in MatroskaContainer and reindent accordingly 2017-10-09 21:16:11 +02:00
Martchus 17c76a5f29 Allow to abort making Mkv file when calculating cues 2017-10-09 21:00:52 +02:00
Martchus b1f207303c Fix warnings in MatroskaContainer 2017-10-09 20:59:43 +02:00
Martchus d717913e99 Improve progress updates when making Mkv file 2017-09-21 23:30:35 +02:00
Martchus cbf63a68aa Compute all Mkv cluster before fixing invalidated cues
This should lead to less 'goto addCuesElementSize;' and
hence boost the time required to calculate sizes. With
the file I tested only one jump was still required after
the change.
2017-09-21 23:30:35 +02:00