Bug 1435709 - Don't attempt to use stagefright to decode theora. r=padenot
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 02 Mar 2018 07:49:25 +0100
changeset 461274 26ae1fdb017c503ef1db721cffc2bbaad2ae3162
parent 461273 921a91c6538bf374b9a6eaca557b4f24e8fa552b
child 461275 5f7fa97d431be663aedbceca2e83f4839f3f5f05
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1435709
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1435709 - Don't attempt to use stagefright to decode theora. r=padenot MozReview-Commit-ID: 215BhSSWGBC
dom/media/platforms/android/AndroidDecoderModule.cpp
--- a/dom/media/platforms/android/AndroidDecoderModule.cpp
+++ b/dom/media/platforms/android/AndroidDecoderModule.cpp
@@ -99,16 +99,23 @@ AndroidDecoderModule::SupportsMimeType(
   // Not all android devices support FLAC even when they say they do.
   if (OpusDataDecoder::IsOpus(aMimeType) ||
       VorbisDataDecoder::IsVorbis(aMimeType) ||
       aMimeType.EqualsLiteral("audio/flac")) {
     LOG("Rejecting audio of type %s", aMimeType.Data());
     return false;
   }
 
+  // Prefer the gecko decoder for Theora.
+  // Not all android devices support Theora even when they say they do.
+  if (TheoraDecoder::IsTheora(aMimeType)) {
+    LOG("Rejecting video of type %s", aMimeType.Data());
+    return false;
+  }
+
   return java::HardwareCodecCapabilityUtils::FindDecoderCodecInfoForMimeType(
     nsCString(TranslateMimeType(aMimeType)));
 }
 
 already_AddRefed<MediaDataDecoder>
 AndroidDecoderModule::CreateVideoDecoder(const CreateDecoderParams& aParams)
 {
   // Temporary - forces use of VPXDecoder when alpha is present.