Bug 1266792 - Don't play opus with AndroidDecoderModule. r?jya
The android 5.1.1 OMX decoder claims to support audio/opus
but crashes on the output of our mp4 demuxer. Work around
this by rejecting the mime type, allowing fallback to the
libopus-based AgnosticDecoderModule.
In any case, since we're shipping the libopus-based decoder
we're prefer to use it for consistency.
MozReview-Commit-ID: GQaTMALajnZ
--- a/dom/media/platforms/android/AndroidDecoderModule.cpp
+++ b/dom/media/platforms/android/AndroidDecoderModule.cpp
@@ -146,16 +146,23 @@ AndroidDecoderModule::SupportsMimeType(c
if ((VPXDecoder::IsVPX(aMimeType, VPXDecoder::VP8) &&
!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; stagefright crashes
+ // on content demuxed from mp4.
+ if (aMimeType.EqualsLiteral("audio/opus")) {
+ LOG("Rejecting audio of type %s", aMimeType.Data());
+ return false;
+ }
+
return java::HardwareCodecCapabilityUtils::FindDecoderCodecInfoForMimeType(
nsCString(TranslateMimeType(aMimeType)));
}
already_AddRefed<MediaDataDecoder>
AndroidDecoderModule::CreateVideoDecoder(const CreateDecoderParams& aParams)
{
MediaFormat::LocalRef format;