Backed out 5 changesets (bug 1611622) for causing bustages.

CLOSED TREE

Backed out changeset 8be308a0ff7d (bug 1611622)
Backed out changeset e6286802e8b5 (bug 1611622)
Backed out changeset ca1198a5d65c (bug 1611622)
Backed out changeset 7f14a871f69e (bug 1611622)
Backed out changeset 1db1f7da1215 (bug 1611622)
This commit is contained in:
Mihai Alexandru Michis 2020-04-17 21:17:37 +03:00
Родитель 41b35dbdf8
Коммит 1ad47078f4
6 изменённых файлов: 4 добавлений и 51 удалений

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

@ -1238,8 +1238,7 @@ RefPtr<MediaRawData> OggTrackDemuxer::NextSample() {
bool eos = packet->e_o_s;
OggCodecState* state = mParent->GetTrackCodecState(mType);
RefPtr<MediaRawData> data = state->PacketOutAsMediaRawData();
// ogg allows 'nil' packets, that are EOS and of size 0.
if (!data || data->mEOS && data->Size() == 0) {
if (!data) {
return nullptr;
}
if (mType == TrackInfo::kAudioTrack) {

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

@ -68,7 +68,6 @@ RefPtr<MediaDataDecoder::InitPromise> VorbisDataDecoder::Init() {
if (!XiphExtradataToHeaders(headers, headerLens,
mInfo.mCodecSpecificConfig->Elements(),
mInfo.mCodecSpecificConfig->Length())) {
LOG(LogLevel::Warning, ("VorbisDecoder: could not get vorbis header"));
return InitPromise::CreateAndReject(
MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
RESULT_DETAIL("Could not get vorbis header.")),
@ -76,8 +75,6 @@ RefPtr<MediaDataDecoder::InitPromise> VorbisDataDecoder::Init() {
}
for (size_t i = 0; i < headers.Length(); i++) {
if (NS_FAILED(DecodeHeader(headers[i], headerLens[i]))) {
LOG(LogLevel::Warning,
("VorbisDecoder: could not get decode vorbis header"));
return InitPromise::CreateAndReject(
MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
RESULT_DETAIL("Could not decode vorbis header.")),
@ -89,7 +86,6 @@ RefPtr<MediaDataDecoder::InitPromise> VorbisDataDecoder::Init() {
int r = vorbis_synthesis_init(&mVorbisDsp, &mVorbisInfo);
if (r) {
LOG(LogLevel::Warning, ("VorbisDecoder: could not init vorbis decoder"));
return InitPromise::CreateAndReject(
MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
RESULT_DETAIL("Systhesis init fail.")),
@ -98,7 +94,6 @@ RefPtr<MediaDataDecoder::InitPromise> VorbisDataDecoder::Init() {
r = vorbis_block_init(&mVorbisDsp, &mVorbisBlock);
if (r) {
LOG(LogLevel::Warning, ("VorbisDecoder: could not init vorbis block"));
return InitPromise::CreateAndReject(
MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
RESULT_DETAIL("Block init fail.")),
@ -107,17 +102,15 @@ RefPtr<MediaDataDecoder::InitPromise> VorbisDataDecoder::Init() {
if (mInfo.mRate != (uint32_t)mVorbisDsp.vi->rate) {
LOG(LogLevel::Warning,
"and codec rate do not match!"));
("Invalid Vorbis header: container and codec rate do not match!"));
}
if (mInfo.mChannels != (uint32_t)mVorbisDsp.vi->channels) {
LOG(LogLevel::Warning,
"and codec channels do not match!"));
("Invalid Vorbis header: container and codec channels do not match!"));
}
AudioConfig::ChannelLayout layout(mVorbisDsp.vi->channels);
if (!layout.IsValid()) {
LOG(LogLevel::Warning,
("VorbisDecoder: Invalid Vorbis header: invalid channel layout!"));
return InitPromise::CreateAndReject(
MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
RESULT_DETAIL("Invalid audio layout.")),
@ -171,7 +164,6 @@ RefPtr<MediaDataDecoder::DecodePromise> VorbisDataDecoder::ProcessDecode(
MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR,
RESULT_DETAIL("vorbis_synthesis:%d", err)),
__func__);
LOG(LogLevel::Warning, ("vorbis_synthesis returned an error"));
}
err = vorbis_synthesis_blockin(&mVorbisDsp, &mVorbisBlock);
@ -180,7 +172,6 @@ RefPtr<MediaDataDecoder::DecodePromise> VorbisDataDecoder::ProcessDecode(
MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR,
RESULT_DETAIL("vorbis_synthesis_blockin:%d", err)),
__func__);
LOG(LogLevel::Warning, ("vorbis_synthesis_blockin returned an error"));
}
VorbisPCMValue** pcm = 0;
@ -195,7 +186,6 @@ RefPtr<MediaDataDecoder::DecodePromise> VorbisDataDecoder::ProcessDecode(
uint32_t rate = mVorbisDsp.vi->rate;
AlignedAudioBuffer buffer(frames * channels);
if (!buffer) {
LOG(LogLevel::Warning, ("VorbisDecoder: cannot allocate buffer"));
return DecodePromise::CreateAndReject(
MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__), __func__);
}
@ -208,7 +198,6 @@ RefPtr<MediaDataDecoder::DecodePromise> VorbisDataDecoder::ProcessDecode(
auto duration = FramesToTimeUnit(frames, rate);
if (!duration.IsValid()) {
LOG(LogLevel::Warning, ("VorbisDecoder: invalid packet duration"));
return DecodePromise::CreateAndReject(
MediaResult(NS_ERROR_DOM_MEDIA_OVERFLOW_ERR,
RESULT_DETAIL("Overflow converting audio duration")),
@ -216,7 +205,6 @@ RefPtr<MediaDataDecoder::DecodePromise> VorbisDataDecoder::ProcessDecode(
}
auto total_duration = FramesToTimeUnit(mFrames, rate);
if (!total_duration.IsValid()) {
LOG(LogLevel::Warning, ("VorbisDecoder: invalid total duration"));
return DecodePromise::CreateAndReject(
MediaResult(
NS_ERROR_DOM_MEDIA_OVERFLOW_ERR,
@ -226,7 +214,6 @@ RefPtr<MediaDataDecoder::DecodePromise> VorbisDataDecoder::ProcessDecode(
auto time = total_duration + aSample->mTime;
if (!time.IsValid()) {
LOG(LogLevel::Warning, ("VorbisDecoder: invalid sample time"));
return DecodePromise::CreateAndReject(
MediaResult(NS_ERROR_DOM_MEDIA_OVERFLOW_ERR,
RESULT_DETAIL(
@ -254,7 +241,6 @@ RefPtr<MediaDataDecoder::DecodePromise> VorbisDataDecoder::ProcessDecode(
mFrames += frames;
err = vorbis_synthesis_read(&mVorbisDsp, frames);
if (err) {
LOG(LogLevel::Warning, ("VorbisDecoder: vorbis_synthesis_read"));
return DecodePromise::CreateAndReject(
MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR,
RESULT_DETAIL("vorbis_synthesis_read:%d", err)),

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

@ -31,7 +31,6 @@
#include "WebAudioUtils.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Logging.h"
#include "nsPrintfCString.h"
#include "AudioNodeEngine.h"
@ -39,9 +38,6 @@ namespace mozilla {
extern LazyLogModule gMediaDecoderLog;
#define LOG(x, ...) \
MOZ_LOG(gMediaDecoderLog, LogLevel::Debug, (x, ##__VA_ARGS__))
using namespace dom;
class ReportResultTask final : public Runnable {
@ -246,7 +242,6 @@ void MediaDecodeTask::OnInitDemuxerCompleted() {
if (!!mDemuxer->GetNumberTracks(TrackInfo::kAudioTrack)) {
mTrackDemuxer = mDemuxer->GetTrackDemuxer(TrackInfo::kAudioTrack, 0);
if (!mTrackDemuxer) {
LOG("MediaDecodeTask: Could not get a track demuxer.");
ReportFailureOnMainThread(WebAudioDecodeJob::UnknownContent);
return;
}
@ -261,7 +256,6 @@ void MediaDecodeTask::OnInitDemuxerCompleted() {
}
if (NS_FAILED(CreateDecoder(*mMediaInfo.mAudio.GetAsAudioInfo()))) {
LOG("MediaDecodeTask: Could not create a decoder.");
ReportFailureOnMainThread(WebAudioDecodeJob::UnknownContent);
return;
}
@ -271,7 +265,6 @@ void MediaDecodeTask::OnInitDemuxerCompleted() {
void MediaDecodeTask::OnInitDemuxerFailed(const MediaResult& aError) {
MOZ_ASSERT(OnPDecoderTaskQueue());
LOG("MediaDecodeTask: Could not initialize the demuxer.");
ReportFailureOnMainThread(WebAudioDecodeJob::InvalidContent);
}
@ -315,7 +308,6 @@ void MediaDecodeTask::OnInitDecoderFailed() {
MOZ_ASSERT(OnPDecoderTaskQueue());
ShutdownDecoder();
LOG("MediaDecodeTask: Could not initialize the decoder");
ReportFailureOnMainThread(WebAudioDecodeJob::InvalidContent);
}
@ -344,7 +336,6 @@ void MediaDecodeTask::OnAudioDemuxFailed(const MediaResult& aError) {
DoDecode();
} else {
ShutdownDecoder();
LOG("MediaDecodeTask: Audio demux failed");
ReportFailureOnMainThread(WebAudioDecodeJob::InvalidContent);
}
}
@ -403,7 +394,6 @@ void MediaDecodeTask::OnAudioDecodeFailed(const MediaResult& aError) {
MOZ_ASSERT(OnPDecoderTaskQueue());
ShutdownDecoder();
LOG("MediaDecodeTask: decode audio failed.");
ReportFailureOnMainThread(WebAudioDecodeJob::InvalidContent);
}
@ -437,7 +427,6 @@ void MediaDecodeTask::OnAudioDrainFailed(const MediaResult& aError) {
MOZ_ASSERT(OnPDecoderTaskQueue());
ShutdownDecoder();
LOG("MediaDecodeTask: Drain audio failed");
ReportFailureOnMainThread(WebAudioDecodeJob::InvalidContent);
}
@ -463,8 +452,6 @@ void MediaDecodeTask::FinishDecode() {
uint32_t sampleRate = mMediaInfo.mAudio.mRate;
if (!frameCount || !channelCount || !sampleRate) {
LOG("MediaDecodeTask: invalid content frame count, channel count or "
"sample-rate");
ReportFailureOnMainThread(WebAudioDecodeJob::InvalidContent);
return;
}
@ -496,7 +483,6 @@ void MediaDecodeTask::FinishDecode() {
ThreadSharedFloatArrayBufferList::Create(channelCount, resampledFrames,
fallible);
if (!buffer) {
LOG("MediaDecodeTask: Could not create final buffer (f32)");
ReportFailureOnMainThread(WebAudioDecodeJob::UnknownError);
return;
}
@ -509,7 +495,6 @@ void MediaDecodeTask::FinishDecode() {
bufferSize *= channelCount;
RefPtr<SharedBuffer> buffer = SharedBuffer::Create(bufferSize);
if (!buffer) {
LOG("MediaDecodeTask: Could not create final buffer (i16)");
ReportFailureOnMainThread(WebAudioDecodeJob::UnknownError);
return;
}
@ -596,7 +581,6 @@ void MediaDecodeTask::AllocateBuffer() {
MOZ_ASSERT(NS_IsMainThread());
if (!mDecodeJob.AllocateBuffer()) {
LOG("MediaDecodeTask: Could not allocate final buffer");
ReportFailureOnMainThread(WebAudioDecodeJob::UnknownError);
return;
}

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

@ -14,7 +14,6 @@ support-files =
file_nodeCreationDocumentGone.html
invalid.txt
layouttest-glue.js
nil-packet.ogg
noaudio.webm
small-shot-expected.wav
small-shot-mono-expected.wav

Двоичные данные
dom/media/webaudio/test/nil-packet.ogg

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

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

@ -203,15 +203,6 @@ var files = [
duration: 1.0807,
fuzzTolerance: 106,
fuzzToleranceMobile: 3482
},
{
url: "nil-packet.ogg",
expectedUrl: null,
valid: true,
numberOfChannels: 2,
sampleRate: 48000,
frames: 18600,
duration: 0.3874,
}
];
@ -260,9 +251,7 @@ function checkAudioBuffer(buffer, test) {
is(buffer.length, test.frames, "Correct length");
var wave = createWaveFileData(buffer);
if (test.expectedWaveData) {
ok(fuzzyMemcmp(wave, test.expectedWaveData, getFuzzTolerance(test)), "Received expected decoded data");
}
ok(fuzzyMemcmp(wave, test.expectedWaveData, getFuzzTolerance(test)), "Received expected decoded data");
}
function checkResampledBuffer(buffer, test, callback) {
@ -356,10 +345,6 @@ function loadTest(test, callback) {
xhr.open("GET", test.url, true);
xhr.responseType = "arraybuffer";
xhr.onload = function() {
if (!test.expectedUrl) {
runTest(test, xhr.response, callback);
return;
}
var getExpected = new XMLHttpRequest();
getExpected.open("GET", test.expectedUrl, true);
getExpected.responseType = "arraybuffer";