Bug 1295886 - P8. Never use AndroidDecoderModule to decode FLAC. r?gerald draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 01 Nov 2017 11:37:09 +0100
changeset 692019 9c46a698fccf2ee25579eaa54b67b1c1006084e2
parent 692018 f8aaecf06a6928dda8186d068c2a2eb74828cce4
child 692020 fa82ebf7bdd553dc264d2b43a7bf5888909bbaef
push id87364
push userbmo:jyavenard@mozilla.com
push dateThu, 02 Nov 2017 09:52:27 +0000
reviewersgerald
bugs1295886
milestone58.0a1
Bug 1295886 - P8. Never use AndroidDecoderModule to decode FLAC. r?gerald The behaviour of the system decoder is unpredictable. MozReview-Commit-ID: FubvCm0xyiL
dom/media/platforms/android/AndroidDecoderModule.cpp
--- a/dom/media/platforms/android/AndroidDecoderModule.cpp
+++ b/dom/media/platforms/android/AndroidDecoderModule.cpp
@@ -151,18 +151,20 @@ AndroidDecoderModule::SupportsMimeType(
        !GetFeatureStatus(nsIGfxInfo::FEATURE_VP8_HW_DECODE)) ||
       (VPXDecoder::IsVPX(aMimeType, VPXDecoder::VP9) &&
        !GetFeatureStatus(nsIGfxInfo::FEATURE_VP9_HW_DECODE))) {
     return false;
   }
 
   // Prefer the gecko decoder for opus and vorbis; stagefright crashes
   // on content demuxed from mp4.
+  // Not all android devices support FLAC even when they say they do.
   if (OpusDataDecoder::IsOpus(aMimeType) ||
-      VorbisDataDecoder::IsVorbis(aMimeType)) {
+      VorbisDataDecoder::IsVorbis(aMimeType) ||
+      aMimeType.EqualsLiteral("audio/flac")) {
     LOG("Rejecting audio of type %s", aMimeType.Data());
     return false;
   }
 
   return java::HardwareCodecCapabilityUtils::FindDecoderCodecInfoForMimeType(
     nsCString(TranslateMimeType(aMimeType)));
 }