Bug 1256590 - Part 2 - Add a test case for skipping over false positive syncs at the beginning of an MP3 file. r=esawin

This commit is contained in:
Jan Henning 2016-03-20 22:08:45 +01:00
Родитель 4c248c7249
Коммит 9e046f3ff6
3 изменённых файлов: 41 добавлений и 0 удалений

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

@ -230,6 +230,46 @@ protected:
mTargets.push_back(streamRes);
}
{
MP3Resource res;
// This file contains a false frame sync at 34, just after the ID3 tag,
// which should be identified as a false positive and skipped.
res.mFilePath = "small-shot-false-positive.mp3";
res.mIsVBR = true;
res.mFileSize = 6845;
res.mMPEGLayer = 3;
res.mMPEGVersion = 1;
res.mID3MajorVersion = 4;
res.mID3MinorVersion = 0;
res.mID3Flags = 0;
res.mID3Size = 24;
res.mDuration = 336686;
res.mDurationError = 0.01f;
res.mSeekError = 0.2f;
res.mSampleRate = 44100;
res.mSamplesPerFrame = 1152;
res.mNumSamples = 12;
res.mNumTrailingFrames = 0;
res.mBitrate = 256000;
res.mSlotSize = 1;
res.mPrivate = 0;
const int syncs[] = { 54, 576, 1098, 1621, 2143, 2666, 3188, 3711, 4233,
4756, 5278, 5801, 6323 };
res.mSyncOffsets.insert(res.mSyncOffsets.begin(), syncs, syncs + 13);
// No content length can be estimated for CBR stream resources.
MP3Resource streamRes = res;
streamRes.mFileSize = -1;
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);
}
for (auto& target: mTargets) {
ASSERT_EQ(NS_OK, target.mResource->Open(nullptr));
ASSERT_TRUE(target.mDemuxer->Init());

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

@ -52,6 +52,7 @@ TEST_HARNESS_FILES.gtest += [
'noise_vbr.mp3',
'short-zero-in-moov.mp4',
'short-zero-inband.mov',
'small-shot-false-positive.mp3',
'small-shot.mp3',
'test.webm',
'test_case_1224361.vp8.ivf',

Двоичные данные
dom/media/gtest/small-shot-false-positive.mp3 Normal file

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