Bug 1203217 - Extend MP3 demuxer gtest to include a test file for large ID3v2 tags. r=kinetik

This adds an MP3 file with an ID3v2 header which used to trip up the MPEG frame parser before bug 1197985 was fixed.
This commit is contained in:
Jan Henning 2015-09-13 16:12:20 +02:00
Родитель 4e9539d667
Коммит 503a8bee81
3 изменённых файлов: 44 добавлений и 0 удалений

Просмотреть файл

@ -109,6 +109,49 @@ protected:
mTargets.push_back(streamRes); mTargets.push_back(streamRes);
} }
{
MP3Resource res;
// This file trips up the MP3 demuxer if ID3v2 tags aren't properly skipped. If skipping is
// not properly implemented, depending on the strictness of the MPEG frame parser a false
// sync will be detected somewhere within the metadata at or after 112087, or failing
// that, at the artificially added extraneous header at 114532.
res.mFilePath = "id3v2header.mp3";
res.mIsVBR = false;
res.mFileSize = 191302;
res.mMPEGLayer = 3;
res.mMPEGVersion = 1;
res.mID3MajorVersion = 3;
res.mID3MinorVersion = 0;
res.mID3Flags = 0;
res.mID3Size = 115304;
res.mDuration = 3160816;
res.mDurationError = 0.001f;
res.mSeekError = 0.02f;
res.mSampleRate = 44100;
res.mSamplesPerFrame = 1152;
res.mNumSamples = 139392;
res.mNumTrailingFrames = 0;
res.mBitrate = 192000;
res.mSlotSize = 1;
res.mPrivate = 1;
const int syncs[] = { 115314, 115941, 116568, 117195, 117822, 118449 };
res.mSyncOffsets.insert(res.mSyncOffsets.begin(), syncs, syncs + 6);
// No content length can be estimated for CBR stream resources.
MP3Resource streamRes = res;
streamRes.mFileSize = -1;
streamRes.mDuration = -1;
streamRes.mDurationError = 0.0f;
res.mResource = new MockMP3MediaResource(res.mFilePath);
res.mDemuxer = new MP3TrackDemuxer(res.mResource);
mTargets.push_back(res);
streamRes.mResource = new MockMP3StreamMediaResource(streamRes.mFilePath);
streamRes.mDemuxer = new MP3TrackDemuxer(streamRes.mResource);
mTargets.push_back(streamRes);
}
{ {
MP3Resource res; MP3Resource res;
res.mFilePath = "noise_vbr.mp3"; res.mFilePath = "noise_vbr.mp3";

Двоичные данные
dom/media/gtest/id3v2header.mp3 Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -42,6 +42,7 @@ TEST_HARNESS_FILES.gtest += [
'../test/gizmo-frag.mp4', '../test/gizmo-frag.mp4',
'../test/gizmo.mp4', '../test/gizmo.mp4',
'dash_dashinit.mp4', 'dash_dashinit.mp4',
'id3v2header.mp3',
'mediasource_test.mp4', 'mediasource_test.mp4',
'noise.mp3', 'noise.mp3',
'noise_vbr.mp3', 'noise_vbr.mp3',