Bug 1295886 - P8. Never use AndroidDecoderModule to decode FLAC. r?gerald
The behaviour of the system decoder is unpredictable.
MozReview-Commit-ID: FubvCm0xyiL
--- 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)));
}