Back out c3ac85cea6a3 (bug 1246358) for failures in test_invalid_reject_play.html

CLOSED TREE
This commit is contained in:
Phil Ringnalda 2016-02-07 19:29:07 -08:00
parent 22b26ff040
commit 2e53a18092

View File

@ -211,10 +211,6 @@ OpusDataDecoder::DoDecode(MediaRawData* aSample)
return -1;
}
if (aDiscardPadding > 0) {
// Padding discard is only supposed to happen on the final packet.
// Record the discard so we can return an error if another packet is
// decoded.
mPaddingDiscarded = true;
OPUS_DEBUG("OpusDecoder discardpadding %" PRId64 "", aDiscardPadding);
CheckedInt64 discardFrames =
TimeUnitToFrames(media::TimeUnit::FromNanoseconds(aDiscardPadding),
@ -225,12 +221,15 @@ OpusDataDecoder::DoDecode(MediaRawData* aSample)
}
if (discardFrames.value() > frames) {
// Discarding more than the entire packet is invalid.
OPUS_DEBUG("Opus error, discard padding larger than packet (%d of %d frames)",
int32_t(discardFrames.value()), frames);
return 0;
OPUS_DEBUG("Opus error, discard padding larger than packet");
return -1;
}
OPUS_DEBUG("Opus decoder discarding %d of %d frames",
int32_t(discardFrames.value()), frames);
// Padding discard is only supposed to happen on the final packet.
// Record the discard so we can return an error if another packet is
// decoded.
mPaddingDiscarded = true;
int32_t keepFrames = frames - discardFrames.value();
frames = keepFrames;
}