Back out c3ac85cea6a3 (bug 1246358) for failures in test_invalid_reject_play.html
authorPhil Ringnalda <philringnalda@gmail.com>
Sun, 07 Feb 2016 19:29:07 -0800
changeset 283426 45554120ac30245ec2d4f7a12fc203ed4ca38586
parent 283425 2294e44c9057e20860cea871209912bef0722fdc
child 283427 de6c0f937e9fb8afaf90acb9f739ce412a65d0f5
push id71528
push userphilringnalda@gmail.com
push dateMon, 08 Feb 2016 03:29:29 +0000
treeherdermozilla-inbound@45554120ac30 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1246358
milestone47.0a1
backs outc3ac85cea6a3d324bf118ef75e20d0bb004838b4
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Back out c3ac85cea6a3 (bug 1246358) for failures in test_invalid_reject_play.html CLOSED TREE
dom/media/platforms/agnostic/OpusDecoder.cpp
--- a/dom/media/platforms/agnostic/OpusDecoder.cpp
+++ b/dom/media/platforms/agnostic/OpusDecoder.cpp
@@ -206,36 +206,35 @@ OpusDataDecoder::DoDecode(MediaRawData* 
   }
 
   if (aDiscardPadding < 0) {
     // Negative discard padding is invalid.
     OPUS_DEBUG("Opus error, negative discard padding");
     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),
                        mOpusParser->mRate);
     if (!discardFrames.isValid()) {
       NS_WARNING("Int overflow in DiscardPadding");
       return -1;
     }
     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;
   }
 
   // Apply the header gain if one was specified.
 #ifdef MOZ_SAMPLE_TYPE_FLOAT32
   if (mOpusParser->mGain != 1.0f) {
     float gain = mOpusParser->mGain;