This patch introduces two more MP3 test cases to exercise MP3FrameParser:
* vbr-head.mp3: This file contains a Xing header which gives an exact duration
of 10 seconds. However, it only contains 4 MP3 frames total for a real
duration of around 1 second. It is expected that we read the Xing header
and report 10 seconds.
* huge-id3.mp3: This file contains more than 130KB of ID3 tags. When we search
for MP3 frames, we give up after X KB of non-MP3 data. ID3 tags should not
count towards the non-MP3 count, since they can be very large. This test
case makes sure the skipping of ID3 tags works correctly.
The test checks the duration of an MP3 file with variable bitrate. The
MP3 file only contains silence. It uses a high bit-rate encoding for its
first half, a low bit-rate encoding for its second half. The correct
duration is 10 seconds, but an incorrect implementation will return a
much shorter value.
The test checks the duration of an MP3 file with variable bitrate. The
MP3 file only contains silence. It uses a high bit-rate encoding for its
first half, a low bit-rate encoding for its second half. The correct
duration is 10 seconds, but an incorrect implementation will return a
much shorter value.
--HG--
extra : rebase_source : f62cf69a631a276c4e6e96e827ab615367cad877
This doesn't do any verification of the output, just checks
that we load multichannel files and playback completes.
These are public-domain test files created by Tim and Monty
last year. They're not great audio quality, the idea is just
to verify correct speaker mapping.
http://people.xiph.org/~greg/opus_testvectors/opus_multichannel_examples/
From 49f5e33d79df3713bc510e611a5064858bf24e4a Mon Sep 17 00:00:00 2001
These files have specially crafted headers which should be
rejected by the new checks added to resolve this bug. If any
audio output is produced then this bug has re-occured.
The audio data is the phrase "invalid file", in one or six
channels, to make this more obvious.
The new mochitest test_invalid_reject.html tries to load
and play each of the new invalid files and verifies that
an error event is triggered. Since the invalid data is in
the file headers, this should happen after network load
but before metadata is ready, so the test also asserts
errors if loadedmetadata or a number of subsequent events
are triggered.
The test will time out if no error event is fired at all.
Thanks to Matthew Gregan for assistance writing the mochitest.
---
content/media/test/Makefile.in | 11 ++++++
content/media/test/invalid-cmap-s0c0.opus | Bin 0 -> 6835 bytes
content/media/test/invalid-cmap-s0c2.opus | Bin 0 -> 6834 bytes
content/media/test/invalid-cmap-s1c2.opus | Bin 0 -> 6848 bytes
content/media/test/invalid-cmap-short.opus | Bin 0 -> 6854 bytes
content/media/test/invalid-m0c0.opus | Bin 0 -> 2471 bytes
content/media/test/invalid-m0c3.opus | Bin 0 -> 2471 bytes
content/media/test/invalid-m1c0.opus | Bin 0 -> 6836 bytes
content/media/test/invalid-m1c9.opus | Bin 0 -> 6836 bytes
content/media/test/invalid-m2c0.opus | Bin 0 -> 2471 bytes
content/media/test/invalid-m2c1.opus | Bin 0 -> 2455 bytes
content/media/test/manifest.js | 14 ++++++++
content/media/test/test_invalid_reject.html | 52 ++++++++++++++++++++++++++++
13 files changed, 77 insertions(+)
create mode 100644 content/media/test/invalid-cmap-s0c0.opus
create mode 100644 content/media/test/invalid-cmap-s0c2.opus
create mode 100644 content/media/test/invalid-cmap-s1c2.opus
create mode 100644 content/media/test/invalid-cmap-short.opus
create mode 100644 content/media/test/invalid-m0c0.opus
create mode 100644 content/media/test/invalid-m0c3.opus
create mode 100644 content/media/test/invalid-m1c0.opus
create mode 100644 content/media/test/invalid-m1c9.opus
create mode 100644 content/media/test/invalid-m2c0.opus
create mode 100644 content/media/test/invalid-m2c1.opus
create mode 100644 content/media/test/test_invalid_reject.html
Verify that we return metadata tags from streams with only a
single comment by adding a single comment to a file which
previously had none.
This bug went undetected because all our examples had either
multiple tags, or none.
Remember parsed comments from the OpusTags header in
an array member variable. Add a method to generate
the nsHTMLMediaElement::MetadataTags hash table from
those entries, performing the same validatation we
do for Vorbis.
This feature is tested by adding the existing opus
test file to gMetadataTests.
IsValidVorbisTagName is moved to a static method
on nsOggCodecState so it can be shared among the
subclasses and easily called externally.
MetadataTags generation for Vorbis streams is moved
to the same method name on nsVorbisState to allow
sharing of the parsing and validation code as much
as possible, since both formats use the same scheme.
It's arguable whether contrustuction better belongs to
nsOggReader or to the nsCodecState subclasses, since in
theory the various multiplexed streams interact in
determining the canonical tag list, but it is the
per-codec streams which contain the metadata in Ogg.
Add a new test file with some invalid comments and verify
they are filtered out of the mozGetMetadata() output.
The new file includes the following valid edge cases:
- empty tag name
- empty tag value
- punctuation in the tag name
and the following invalid cases:
- non-ascii tag name
- invalid characters in tag name
- non-utf-8 tag value
- no tag=value separator
Also updates the mochitest messages to be less confusing.