Two advantages:
1. This way invalid UTF-8 characters will be replaced by the Unicode
Replacement Character U+FFFD instead of keeping invalid UTF-8
encodings in text.
2. Preparation for the conversion from (J)PCRE2 to QRegularExpression
which requires converting between UTF-8-encoded `std::string` and
QString.
A sequence is detected as follows:
1. The current file name is split into three parts if possible: a
prefix, a running number and a digit-less suffix.
2. If successful, the result is compared with the result of the same
split for the previous file name. They're considered to be in
sequence if the previous file name's prefix & suffix match the
current file name's prefix & suffix and if the current running
number is higher than the previous one by 1.
In such a case only the first file is added. The other files in the
same sequence will be appended to the first one.
Implements #2866.
The order is: video first followed by audio, subtitles and other
types.
For files this means that a file without video tracks will be inserted
after one with one or more video tracks.
In general the files & tracks are inserted before the first
entry (file respectively track) that has a lower priority than the
entry to insert. For example, let's assume that the user has already
added one video, three audio and three subtitle tracks and they're
currently ordered as follows:
* existing video
* existing audio 1
* existing audio 2
* existing subtitles 1
* existing subtitles 2
* existing subtitles 3
* existing audio 3
When adding audio track number 4 the GUI will start comparing the
track priorities starting at the top. The first existing entry with a
priority lower than the new entry to add (a new audio track) is the
first subtitles track, "existing subtitles 1". The new order will
therefore look as follows:
* existing video
* existing audio 1
* existing audio 2
* newly added audio 4
* existing subtitles 1
* existing subtitles 2
* existing subtitles 3
* existing audio 3
This option only determines the initial order. The user can still
change the order manually as they see fit afterwards.
The option is enabled by default.
Implements #2366.
fmt v8 currently contains a bug that causes compilation to fail if
`FMT_USE_USER_DEFINED_LITERALS` is defined to 0. This is a regression
from earlier versions. A bug has been filed against fmt:
https://github.com/fmtlib/fmt/issues/2384
MKVToolNix defined this to 0 as earlier fmt versions caused warnings
in their code dealing with user-defined literals with
`-Wpedantic`. Luckily those warnings do not occur with v8 anymore.
The fix is to test in `configure` if the fmt version we're compiling
with is v8 or older, and only to define
`FMT_USE_USER_DEFINED_LITERALS` to 0 for earlier versions.
Fixes#3151.
Somewhere in the code seemed to be a conversion from to 32-bit integer
types for storing or converting from/to seconds since epoch. This
means that dates before seconds-since-epoch 0 (1970-01-01 00:00:00
UTC) or after seconds-since-epoch std::max<int32_t>() (2038-01-19
03:14:08 UTC) could not be converted to displayable strings.
Qt's QDateTime is not affected by this issue, not even on
Windows. Therefore the header editor wasn't affected as it solely used
QDateTime for all conversions, not the C & C++ standard library
functions.
This only happened on Windows.
Affected were mkvmerge (values in JSON identification mode, timestamps
in track statistics tags), mkvinfo (outputting any EBML date element),
MKVToolNix GUI's info tool (again outputting any EBML data element).
Fixes#3148.