Bug 1322070: P1. Don't attempt to decode some audio format. r?jolin draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 05 Dec 2016 08:05:35 +1100
changeset 448641 27e7177381c5716583674b196ed3ac7e8c186fa0
parent 448640 b184d28790bcf1459cadfee660a7c374814149da
child 448642 6c9e3e50988dcd7080cc7560913e0c463a051a31
push id38389
push userbmo:jyavenard@mozilla.com
push dateMon, 12 Dec 2016 05:01:11 +0000
reviewersjolin
bugs1322070
milestone53.0a1
Bug 1322070: P1. Don't attempt to decode some audio format. r?jolin Rather than asserting that the bit depth is 16 bits, let it fallback to other PDMs MozReview-Commit-ID: DnO3nvgEFAe
dom/media/platforms/android/AndroidDecoderModule.cpp
--- a/dom/media/platforms/android/AndroidDecoderModule.cpp
+++ b/dom/media/platforms/android/AndroidDecoderModule.cpp
@@ -203,17 +203,20 @@ AndroidDecoderModule::CreateVideoDecoder
                                               aParams.mTaskQueue);
   return decoder.forget();
 }
 
 already_AddRefed<MediaDataDecoder>
 AndroidDecoderModule::CreateAudioDecoder(const CreateDecoderParams& aParams)
 {
   const AudioInfo& config = aParams.AudioConfig();
-  MOZ_ASSERT(config.mBitDepth == 16, "We only handle 16-bit audio!");
+  if (config.mBitDepth != 16) {
+    // We only handle 16-bit audio.
+    return nullptr;
+  }
 
   MediaFormat::LocalRef format;
 
   LOG("CreateAudioFormat with mimeType=%s, mRate=%d, channels=%d",
       config.mMimeType.Data(), config.mRate, config.mChannels);
 
   NS_ENSURE_SUCCESS(MediaFormat::CreateAudioFormat(
       config.mMimeType,