Bug 1320705: P8. Don't use stagefright to decode vorbis. r?gerald
Fixing the codec mimetype in P6, had the side effect of Android PDM trying to use the stagefright decoder which crashes.
MozReview-Commit-ID: 1OSGGCTdGFO
--- a/dom/media/platforms/android/AndroidDecoderModule.cpp
+++ b/dom/media/platforms/android/AndroidDecoderModule.cpp
@@ -7,16 +7,19 @@
#include "MediaCodecDataDecoder.h"
#include "RemoteDataDecoder.h"
#include "MediaInfo.h"
#include "VPXDecoder.h"
#include "MediaPrefs.h"
+#include "OpusDecoder.h"
+#include "VorbisDecoder.h"
+
#include "nsPromiseFlatString.h"
#include "nsIGfxInfo.h"
#include "prlog.h"
#include <jni.h>
#undef LOG
@@ -151,19 +154,20 @@ 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
+ // Prefer the gecko decoder for opus and vorbis; stagefright crashes
// on content demuxed from mp4.
- if (aMimeType.EqualsLiteral("audio/opus")) {
+ if (OpusDataDecoder::IsOpus(aMimeType) ||
+ VorbisDataDecoder::IsVorbis(aMimeType)) {
LOG("Rejecting audio of type %s", aMimeType.Data());
return false;
}
return java::HardwareCodecCapabilityUtils::FindDecoderCodecInfoForMimeType(
nsCString(TranslateMimeType(aMimeType)));
}