Backed out changeset 2198e282bdcf (bug 1451681) for bustage in /builds/worker/workspace/build/src/dom/media/platforms/agnostic/bytestreams/AnnexB.cpp on a CLOSED TREE
authorMargareta Eliza Balazs <ebalazs@mozilla.com>
Thu, 12 Apr 2018 16:30:43 +0300
changeset 412977 969deb7a468c6b68fdf921a2e16a8a5302417e1e
parent 412976 2198e282bdcf9cee653dfa3e4fd365444b4ef60a
child 412978 c0900d55df7b194d48fa1050dc7feedd1d159498
push id33828
push userarchaeopteryx@coole-files.de
push dateThu, 12 Apr 2018 19:19:41 +0000
treeherdermozilla-central@6e22c4a726c2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1451681
milestone61.0a1
backs out2198e282bdcf9cee653dfa3e4fd365444b4ef60a
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
Backed out changeset 2198e282bdcf (bug 1451681) for bustage in /builds/worker/workspace/build/src/dom/media/platforms/agnostic/bytestreams/AnnexB.cpp on a CLOSED TREE
dom/media/mp4/Index.cpp
dom/media/platforms/agnostic/bytestreams/AnnexB.cpp
--- a/dom/media/mp4/Index.cpp
+++ b/dom/media/mp4/Index.cpp
@@ -161,17 +161,17 @@ already_AddRefed<MediaRawData> SampleIte
       writer->mCrypto.mKeyId.AppendElements(sampleInfo->mKeyId);
     }
 
     if (!reader.ReadArray(writer->mCrypto.mIV, ivSize)) {
       return nullptr;
     }
 
     auto res = reader.ReadU16();
-    if (res.isOk() && res.unwrap() > 0) {
+    if (res.isOk()) {
       uint16_t count = res.unwrap();
 
       if (reader.Remaining() < count * 6) {
         return nullptr;
       }
 
       for (size_t i = 0; i < count; i++) {
         auto res_16 = reader.ReadU16();
--- a/dom/media/platforms/agnostic/bytestreams/AnnexB.cpp
+++ b/dom/media/platforms/agnostic/bytestreams/AnnexB.cpp
@@ -69,23 +69,18 @@ AnnexB::ConvertSampleToAnnexB(mozilla::M
       return Err(NS_ERROR_OUT_OF_MEMORY);
     }
 
     // Prepending the NAL with SPS/PPS will mess up the encryption subsample
     // offsets. So we need to account for the extra bytes by increasing
     // the length of the first clear data subsample. Otherwise decryption
     // will fail.
     if (aSample->mCrypto.mValid) {
-      if (aSample->mCrypto.mPlainSizes.Length() == 0) {
-        samplewriter->mCrypto.mPlainSizes.AppendElement(annexB->Length());
-        samplewriter->mCrypto.mEncryptedSizes.AppendElement(
-          samplewriter->Size() - annexB->Length());
-      } else {
-        samplewriterwriter->mCrypto.mPlainSizes[0] += annexB->Length();
-      }
+      MOZ_ASSERT(samplewriter->mCrypto.mPlainSizes.Length() > 0);
+      samplewriter->mCrypto.mPlainSizes[0] += annexB->Length();
     }
   }
 
   return Ok();
 }
 
 already_AddRefed<mozilla::MediaByteBuffer>
 AnnexB::ConvertExtraDataToAnnexB(const mozilla::MediaByteBuffer* aExtraData)