In #2306 a file was provided with an edit list consisting of two
identical entries that span the whole duration of the file as given by
the file headers. The difference to earlier provided files is that the
edits don't start at 0 but slightly later. Therefore a check for
"starting at 0" seems counterproductive.
Fixes#2306.
Empty ISO 639-1 codes led to `<ISO_639_1_CODES>` looking like
e.g. `de|en||nl`. That would also match an empty string. Therefore the
whole regex would match where it wasn't supposed to. An example:
File name: `This... is strange.[eng].srt`
With the default regex, the first `..` is what would be matched, the
capturing parenthesis would be empty, and therefore no language would
be detected.
Fixes#2298.
MP4Box doesn't like empty SPU packets and aborts with the message
"Corrupted data found in file…". As empty SPU packets serve no
purpose, just drop them during extraction.
Implements #2293.
On Windows the setting names aren't case sensitive, but on other
systems they are. This means that writing something as `abcTheseTypes`
and reading it back as `abcThesetypes` won't work.
Fixes#2297.
`FindNextID` considers anything that looks like an ID to be valid. If
the resulting ID is neither a known global nor an element from the
passed context, a Dummy Element is returned instead.
Therefore mkvextract must verify that the element found is indeed an
EBM Head element in order to determine whether or not the source file
is actually a Matroska/WebM file.
Fixes#2281.
There are several files out there with the following constellation:
* The video track contains an edit list with two entries.
* Both entries are identical.
* Both entries span the whole file's duration (they start at timestamp
0 and span the time given in the movie header atom).
* The audio track doesn't have an edit list.
The result was that the video track was copied twice, the audio track
only once.
This enhancement changes mkvmerge to ignore the second, bogus entry if
these conditions are met.
See #2196 and #2270.
All elements starting with and after the first cluster are only loaded
partially (only their element head). Their child elements are loaded
on demand: when the user expands that element in the GUI. On
collapsing the element the children are deleted again in order to keep
memory usage down.
Implements the rest of #2104.
The FLAC specs specifically state that the only tag/comment system is
the FLAC comment header. It also states that the reference FLAC
utility can skip ID3 tags in FLAC files — but only as a courtesy, that
they're not part of the spec and that other utilities will likely not
work with such files.
mkvmerge now works with such files, too.
Implements #2243.
Prior to this change both fields were often set according to the
features that were enabled. For example, the 'doc type read version'
was set to 2 no matter whether or not a `SimpleBlock` element was
actually used unless the `--engage no_simpleblocks` option was used.
Now the decision is based solely on which elements and which values
are written.
Part of the fix of #2240.
Normally the ESDS contains the decoder-specific configuration for AAC
tracks. If it doesn't, then a default configuration will now be
generated based on the track's header data (sample rate, channels).
Fixes#2221.
The code path for handling appending was only triggered if there was
exactly one entry between the parenthesis (e.g. `… + '(' VTS_02_1.VOB
')'`), but not with two and more.
Additional parts are usually only used for content from DVDs, and
appending content from DVDs is not an often-used function, it
seems. Therefore this bug didn't affect the vast majority of users.
For example: you add a file, disable the second audio track. Then you
append another file (again having two audio tracks). The second audio
track from the appended file will end up appended to the second audio
track from the first file by default — and as that is disabled, the
appended second audio track should be disabled too.
This is even clearer when considering that the GUI doesn't allow the
user to enable an appended track that's appended to a disabled track.
Unlike e.g. the track language, which only applies to the single
destination track, the subtitle character set is a property of the
source file/source container format. Therefore the user must be able
to set it for each source file/track, too. mkvmerge already follows
that model.
Fixes#2214.
On Windows libmagic uses the ANSI file functions for opening
files. Therefore passing file names with non-ASCII/non-ANSI characters
won't work a lot of the time. Therefore letting libmagic's look for
and use its default location algorithm is safer. As a result
`magic.mgc` must be stored in `share/misc` instead of `data`.
Fixes#2212.
If the first level 1 element after the resync is something
else (e.g. chapters, tags, cues etc.), then no element is returned,
and the result would be a segfault.
Fixes#2211.
Before this change the incomplete packet would be filled with data
from other PES packets from after the error location. This would lead
to invalid frame data.
So now both the currently incomplete PES packet as well as all
following TS packets that don't have the
`payload_unit_start_indicator` flag set will be dropped.
mkvmerge assumes an error is present either if the
`transport_error_indicator` flag is set in the transport stream packet
header, or if the `continuity_counter` header field's value doesn't
match the expected value based on the previous transport stream packet
for the same track.
Fixes#2181.
A transport stream packet doesn't have to contain a packetized
elementary stream packet. If a TS packet is treated as such and
doesn't actually contain a PES packet, then trying to extract
timestamps from it will only result in invalid timestamps.
Fixes#2193.
When an `mm_read_buffer_io_c` instance was created, it assumed the
underlying I/O object's stream position was 0. This doesn't have to be
the case, though. As the read buffer I/O class caches the file
position, too, this lead to it returning data from the wrong portion
of the underlying I/O object on subsequent reads.
One observable issue was that trying to detect the file type of MPLS
files that refer to short M2TS files failed with segmentation
faults.
The features removed are:
* mkvmerge: the options `--identify-verbose` (and its counterpart
`-I`), `--identify-for-gui`, `--identify-for-mmg` and
`--identification-format verbose-text`
* all command line tools: the old, proprietary format used for option
files
* all command line tools: support for passing command line options via the
environment variables `MKVTOOLNIX_OPTIONS`, `MKVEXTRACT_OPTIONS`,
`MKVINFO_OPTIONS`, `MKVMERGE_OPTIONS`, and `MKVPROPEDIT_OPTIONS`
Lacing works with a base timestamp for all frames in the
lace. Individual frame timestamps are calculated by adding the default
duration times the frame number (starting at 0) to the base timestamp.
This means that a gap in the timestamps cannot be expressed between
frames within the same lace. Therefore the first frame after each gap
must start its own lace.
Fixes#1700.
When mkvmerge is told to `--fix-bitstream-timing-information`, it will
now update all SPS NALUs, not just the ones in the AVCC.
Part of the fix for #1673.
The earlier algorithm tried to ensure that the values for
`num_units_in_tick` and `time_scale` fit into 32 bits. However, the
result was that the numbers were only approximation — e.g. 50 fields
per second were expressed as 5368709 / 268435456 instead of 1 / 50.
This mostly fails on timestamp elements as the original value is an
invalid date and the current value is the minimum that Qt's
`QDateTime` control allows at that moment. That's usually something
like 2000-01-01 00:00:00.
However, if the element isn't present in the file, then it doesn't
matter what the current value in the GUI is — it won't be written
anyway. Therefore it shouldn't be used in the decision whether or not
to ask the user to confirm discarding unsaved changes.
Fixes#2167.
The property element tables are initialized only once. At that point
the stored strings should be the English ones as
`translatable_string_c` instances so that they can be translated later
to whatever language is active at that moment.
The old code wasn't initializing the `translatable_string_c` instances
with the English texts, though, but with already translated
ones (e.g. German). This means that any later attempt to translate
them to the current locale (e.g. French) would fail as there's no
translation from e.g. German to French, only from English to French.
Fixes#2159.
The `getline` function tries to handle different line ending
styles (carriage returns, new lines, a mix of both). For that it has
to probe one more character after having found one of them. If that
probed character is not one of them, then the previous position has to
be restored — and that was wrongfully assuming that each character is
only one byte long. Which it isn't.
Fixes#2160.
Older versions suffered from issues such as segmentation faults on
startup with optimization levels higher than `-O2` or with
`-fipa-icf`. v7.2.0 is OK, though.
Older versions suffered from excessive memory usage with optimization
levels higher than `-O1`:
%https://bugs.llvm.org/show_bug.cgi?id=11962
v3.8.0 is known to be OK, though.
Audio frames at the start of the file should have higher precedence,
especially over formats that don't always have start codes at the
beginning of the file.
Fixes certain AC-3 files being mis-detected as encrypted MPEG program streams.