Commit Graph

907 Commits

Author SHA1 Message Date
Moritz Bunkus
4442cd5673 MPEG TS: rewrite packet parsing
The old code was pretty convoluted and hard to reason about. On top of
that it didn't buffer PES packets properly before trying to parse the
PES headers. This lead to accesses beyond the end of the buffer.
2016-07-09 17:24:20 +02:00
Moritz Bunkus
1a7222fdbf chapters: update list of ccTLDs; handle deprecated codes
Updated the list of valid top level domain country codes. Deprecated
codes such as "gb" are mapped to their current representation ("uk")
during merging, extraction, in the GUI's chapter editor and in its
preferences.

Fixes #1731.
2016-07-03 15:09:21 +02:00
Moritz Bunkus
b7c2ac3f17 WavPack: don't check minor version number
Fixes #1720.
2016-07-03 12:17:33 +02:00
Moritz Bunkus
14def7c1e0 TrueHD: fix sampling rate parsing
The first 4 bits are the ones containing the output sampling rate, not
the second 4 bits. Fixes the handling of 96 kHz-upsampled audio.
2016-06-27 19:41:25 +02:00
Moritz Bunkus
efa42bd7cc parse_number_with_unit: don't use double; fix "i" unit for fraction syntax
This re-writes the "parse_number_with_unit" not to use the "double" data
type internally but int64_t-based fractions. This fixes issues with
"double" precision on certain 32bit platforms and test cases failing.
This is a fix for #1705.

Due to this change the handling of the syntax "1234/56i" with "i" as the
unit was fixed as well. Before the value was wrongfully multiplied
instead of divided by 2 leading to quadruple the expected value being
returned. This was mentioned in and fixes part of #1673.
2016-06-04 13:22:46 +02:00
Moritz Bunkus
5cce934976 common: add string floating point number parsing to rational objects 2016-06-04 12:11:24 +02:00
Moritz Bunkus
d0f93f4a59 chapter generation: interval: fix last chapter after end of file 2016-05-15 12:07:32 +02:00
Moritz Bunkus
eaa74b882c chapter generation: handle failing void replacement by writing chapters at end
The overwrite function already takes care of updating the element's size
properly. Therefore it doesn't have to be done by mkvmerge before
calling the function, especially if it's called wrong:

- our manual call doesn't include elements with default value in the
  calculation
- the replacement request does

This led to the situation where mkvmerge thought that the new chapters
would fit into the void while the replacement function disagreed causing
the chapters not the be written at all.

Fixes #1693.
2016-05-15 11:58:55 +02:00
Moritz Bunkus
0094e3ffa2 tests: add option for listing all failed case IDs 2016-05-13 19:46:12 +02:00
Moritz Bunkus
59b64ddf69 tests: intentional update due to 33eebec45a 2016-05-12 19:28:53 +02:00
Moritz Bunkus
00146f0f5e MPEG TS: probe for (E-)AC-3 if PMT descriptor's present even with unknown stream types
Fixes #1684.
2016-05-06 14:15:17 +02:00
Moritz Bunkus
b7cbbdd0d3 mkvmerge, mkvextract: byte-swap all Big Endian bit depths to Little (e.g. 24)
Fixes #1683.
2016-05-05 19:12:42 +02:00
Moritz Bunkus
3a21661076 PCM output: fix codec ID for bit depths other than 16, 32 or 64
The codec ID was wrongfully set to indicate Little Endian even if the
source was Big Endian and could not be converted to Little Endian.

Fixes #1683.
2016-05-05 18:51:54 +02:00
Moritz Bunkus
71a0f72f48 DTS: set "audio bit depth" header field from source bit depth
Implements #1680.
2016-05-04 15:51:33 +02:00
Moritz Bunkus
49502a0cec DTS: add source's bits/sample in JSON/verbose identification output
See #1680.
2016-05-04 13:19:13 +02:00
Moritz Bunkus
97be4b02c0 tests: use different file for MIME type recognition tests
Newer versions of libmagic detect XML files as text/xml, older ones as
application/xml, making this unsuitable for use as a test case.
2016-05-04 12:55:46 +02:00
Moritz Bunkus
1569bc3d5a simple_test class: ignore non-hashing command in error output 2016-05-04 12:48:14 +02:00
Potato
610f1144db translations: update Korean 2016-05-02 19:48:25 +02:00
Moritz Bunkus
8b56a68d18 Revert "AVC/h.264: mark frames with I slices (type I or I2) as key frames (open GOP)"
This reverts commit d5b87747b5.

The reason is that this seems to be the wrong thing to do; not all such
frame types are actually independently decodable. See the discussion in
issue #1671.
2016-05-02 14:38:53 +02:00
Moritz Bunkus
884a627622 mkvmerge: move parse_number_with_unit to common 2016-04-27 22:00:16 +02:00
Moritz Bunkus
d5b87747b5 AVC/h.264: mark frames with I slices (type I or I2) as key frames (open GOP)
In MP4 such samples aren't marked as sync points but they are marked as
random access points by way of the "rap " atom. In Matroska both kinds
of samples have to be marked as key frames.

Fixes #1671 where only open GOP key frame sequences occur and no regular
key frame sequences (IDR NALUs with I or SI slices) causing mkvmerge not
to find any key frames and to buffer the whole file before writing it out.
2016-04-26 21:10:27 +02:00
Moritz Bunkus
08ad764c62 libmatroska: update to latest development version
Due to the addition on new mandatory elements the calculation of default
sizes for void elements is different. Therefore most test cases have had
their checksums updated.
2016-04-25 20:24:11 +02:00
Moritz Bunkus
15e389f192 MPEG TS/teletext: include teletext page number in identification output 2016-04-23 14:57:42 +02:00
Moritz Bunkus
5e867eb8f4 MPEG TS: set text_subtitles identification property for teletext subs only 2016-04-23 14:46:11 +02:00
Moritz Bunkus
8f90b90c98 MPEG TS/teletext: support multiple teletext pages in single track
mkvmerge will not expose each teletext page as a single track.

See #1662.
2016-04-23 14:30:32 +02:00
Moritz Bunkus
b528f29412 MPEG TS/teletext: set page to use from TS teletext descriptor 2016-04-21 17:02:51 +02:00
Moritz Bunkus
0dc43cccb5 AVI reader: handle errors during audio chunk reading
Fixes #1657.
2016-04-13 19:37:34 +02:00
Moritz Bunkus
65e4d9c082 mkvextract: add support for WebVTT subtitles
Implements the extraction part of #1189.
2016-04-11 21:58:12 +02:00
Moritz Bunkus
680dff7a3f timestamp_c: add function for negation 2016-04-11 21:58:12 +02:00
Moritz Bunkus
c0c8ea01aa mkvmerge: add support for WebVTT
Implements the merge part of #1189. Extraction is still outstanding.
2016-04-11 21:58:11 +02:00
Moritz Bunkus
95dd536fe6 tests: remove debug output 2016-04-09 18:10:22 +02:00
Moritz Bunkus
db45155c02 test 449: only test for success, not for content
Some of the sub-tests in 449 have to work with uninitialized data due to
the file structure errors in the source files. Therefore the data's
content may actually change from run to run. Such a change was triggered
with change f82360d. Therefore only test whether or not muxing succeeds
for those sub-tests, not what the actual content looks like.
2016-04-09 18:08:02 +02:00
Moritz Bunkus
38ce7f9d8c functions for normalizing line endings/removing them from end of string 2016-04-09 17:27:25 +02:00
Moritz Bunkus
f82360deb8 kax_reader_c: use kax_file_c for reading the headers
kax_file_c has built-in error resilience and will re-sync to the next
level 1 element in case of a structural error. This way a structural
error before the first cluster won't cause mkvmerge to abort the reading
process.

Fixes #1654.
2016-04-09 15:48:10 +02:00
Moritz Bunkus
4a1219ca76 mkvmerge: add muxing date to identification output for Matroska files 2016-04-03 11:54:12 +02:00
Moritz Bunkus
4ca858fa15 mkvmerge: add muxing_application/writing_application to identification output 2016-04-02 16:31:13 +02:00
Moritz Bunkus
c8ba161c8e mkvmerge: add track's minimum timestamp to identification output for Matroska
Frontends like gMKVExtractGUI currently use mkvinfo for determining the
offset between tracks. This is an attempt to provide that information
with mkvmerge.
2016-04-02 16:17:36 +02:00
Moritz Bunkus
97427d2fd0 AVC/h.264: handle interlaced bottom field first correctly
The currently queued frames must be flushed before either a progressive
key frame or before the first field of an interlaced key frame. The
first field may also be the bottom field even though that is rare.
2016-03-29 22:08:43 +02:00
Moritz Bunkus
e1484ae588 DTS packetizer: only use channel count from core when reducing 2016-03-27 15:00:55 +02:00
Moritz Bunkus
f21b7ca87d test base class: method for identifying file & returning parsed JSON 2016-03-27 15:00:12 +02:00
Moritz Bunkus
e711da0913 Teletext→SRT: ignore non-subtitle pages; use correct timestamps for start/end
Fixes #1623.
2016-03-24 20:42:47 +01:00
Moritz Bunkus
eb83d0a3db translations: integrate new Korean translations 2016-03-21 17:37:36 +01:00
Moritz Bunkus
6e2a738e82 teletext subtitles: collapse multiple entries with same content into single entry
The sample file in question contains many teletext packets that show the
same content. The old code would convert those to separate Matroska
frames.

Additionally each frame's duration was calculated from the wrong
timestamp. A teletext page can be drawn over the space of several
packets with different timestamps. Therefore the timestamp of the first
packet rendering a line of a teletext page must be used as the start
timestamp, and the timestamp of the first packet rendering a line of the
following teletext page as its end.

The old code was using a wrong packet for the end, though: the timestamp
of packet containing the end-of-page block.

Fixes #1623.
2016-03-17 12:54:27 +01:00
Moritz Bunkus
8a8d188b46 FLAC reader: report bits/sample in identification 2016-03-12 12:42:25 +01:00
Moritz Bunkus
952c70cf6f Revert "MPEG-H: don't include SEI NALUs twice"
This reverts commit 8a1e641762.

The aforementioned commit 8a1e641 changed mkvmerge's behavior regarding
SEI NALUs. Before 8a1e641 mkvmerge would include all SEI NALUs it
encountered together with the following slice NALUs in a Matroska block.

Commit 8a1e641 changed this to drop those SEI NALUs instead. The reason
for dropping it was that mkvextract re-creates certain types of SEI
NALUs from information stored in the HEVCC (codec private
data). Therefore this information was actually duplicated in the
extracted bitstream. With 8a1e641 the duplication did not happen
anymore.

Unfortunately only certain types of SEI NALUs are actually stored in the
HEVCC (user data information SEIs), others are not stored there. The
result of 8a1e641 was that those other SEI NALUs were irrevocably lost
during muxing. Therefore this fix is now reverted which fixes #1621.

The duplication in mkvextract will be tackled with a separate commit.
2016-03-11 16:18:55 +01:00
Moritz Bunkus
8ca1160de0 SRT, SSA readers: ignore --sub-charset for files containing a BOM
Fixes #1620.
2016-03-09 20:15:15 +01:00
Moritz Bunkus
139bc3b788 mkvextract: extract Big Endian PCM (A_PCM/INT/BIG) to WAV 2016-03-07 19:02:41 +01:00
Moritz Bunkus
efcfabc983 PCM packetizer: byte-swap Big Endian PCM to Little Endian PCM
A lot of players out there don't support Big Endian PCM inside
Matroska.
2016-03-07 18:59:22 +01:00
Moritz Bunkus
4cacf70c6e tests: add cases for generating chapters without video tracks 2016-03-02 13:10:12 +01:00
Moritz Bunkus
ce7c31f49b mkvmerge: implement chapter generation when appending/in fixed intervals
Implements mkvmerge's part of #1586.
2016-03-01 23:37:01 +01:00