Bug 1570958 - Demote some WebMWriter assertions to keep release builds clean and happy. r=jib
authorAndreas Pehrson <apehrson@mozilla.com>
Fri, 02 Aug 2019 16:31:04 +0000
changeset 485990 ff0125384d06fefae3ca60435b85a9be0fd9744e
parent 485989 5babcd57c4945d74a0c97548b32bbfc3a45d25be
child 485991 17ea0740773194cd5a8a172039a905b412f8c707
push id91571
push userpehrsons@gmail.com
push dateFri, 02 Aug 2019 16:32:33 +0000
treeherderautoland@ff0125384d06 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1570958
milestone70.0a1
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
Bug 1570958 - Demote some WebMWriter assertions to keep release builds clean and happy. r=jib Differential Revision: https://phabricator.services.mozilla.com/D40447
dom/media/webm/WebMWriter.cpp
--- a/dom/media/webm/WebMWriter.cpp
+++ b/dom/media/webm/WebMWriter.cpp
@@ -71,39 +71,39 @@ nsresult WebMWriter::SetMetadata(
       }
     }
   }
   if (bad) {
     return NS_ERROR_FAILURE;
   }
 
   // Storing
-  bool hasAudio = false;
-  bool hasVideo = false;
+  DebugOnly<bool> hasAudio = false;
+  DebugOnly<bool> hasVideo = false;
   for (const RefPtr<TrackMetadataBase>& metadata : aMetadata) {
     MOZ_ASSERT(metadata);
 
     if (metadata->GetKind() == TrackMetadataBase::METADATA_VP8) {
-      MOZ_DIAGNOSTIC_ASSERT(!hasVideo);
+      MOZ_ASSERT(!hasVideo);
       VP8Metadata* meta = static_cast<VP8Metadata*>(metadata.get());
       mEbmlComposer->SetVideoConfig(meta->mWidth, meta->mHeight,
                                     meta->mDisplayWidth, meta->mDisplayHeight);
       hasVideo = true;
     }
 
     if (metadata->GetKind() == TrackMetadataBase::METADATA_VORBIS) {
-      MOZ_DIAGNOSTIC_ASSERT(!hasAudio);
+      MOZ_ASSERT(!hasAudio);
       VorbisMetadata* meta = static_cast<VorbisMetadata*>(metadata.get());
       mEbmlComposer->SetAudioConfig(meta->mSamplingFrequency, meta->mChannels);
       mEbmlComposer->SetAudioCodecPrivateData(meta->mData);
       hasAudio = true;
     }
 
     if (metadata->GetKind() == TrackMetadataBase::METADATA_OPUS) {
-      MOZ_DIAGNOSTIC_ASSERT(!hasAudio);
+      MOZ_ASSERT(!hasAudio);
       OpusMetadata* meta = static_cast<OpusMetadata*>(metadata.get());
       mEbmlComposer->SetAudioConfig(meta->mSamplingFrequency, meta->mChannels);
       mEbmlComposer->SetAudioCodecPrivateData(meta->mIdHeader);
       hasAudio = true;
     }
   }
   mEbmlComposer->GenerateHeader();
   return NS_OK;