Bug 918135 - More tests for MP3FrameParser r=cpearce

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.
This commit is contained in:
Edwin Flores 2013-12-03 10:25:28 +13:00
parent 19c2ca3567
commit b4ff67ed3a
4 changed files with 12 additions and 0 deletions

Binary file not shown.

View File

@ -188,6 +188,16 @@ var gPlayTests = [
// owl.mp3 as above, but with something even funnier going on in the ID3v2 tag
// that causes DirectShow to fail.
{ name:"owl-funnier-id3.mp3", type:"audio/mpeg", duration:3.29 },
// One second of silence with ~140KB of ID3 tags. Usually when the first MP3
// frame is at such a high offset into the file, MP3FrameParser will give up
// and report that the stream is not MP3. However, it does not count ID3 tags
// in that offset. This test case makes sure that ID3 exclusion holds.
{ name:"huge-id3.mp3", type:"audio/mpeg", duration:1.00 },
// A truncated VBR MP3 with just enough frames to keep most decoders happy.
// The Xing header reports the length of the file to be around 10 seconds, but
// there is really only one second worth of data. We want MP3FrameParser to
// trust the header, so this should be reported as 10 seconds.
{ name:"vbr-head.mp3", type:"audio/mpeg", duration:10.00 },
// Invalid file
{ name:"bogus.duh", type:"bogus/duh", duration:Number.NaN }

View File

@ -97,6 +97,7 @@ support-files =
fragment_noplay.js
fragment_play.js
gizmo.mp4
huge-id3.mp3
id3tags.mp3
invalid-cmap-s0c0.opus
invalid-cmap-s0c2.opus
@ -164,6 +165,7 @@ support-files =
variable-preskip.opus
variable-samplerate.ogg
variable-samplerate.opus
vbr-head.mp3
vbr.mp3
VID_0001.ogg
video-overhang.ogg

Binary file not shown.