From 38fc20426edbea9a4e66d6f9769c8c2daa957181 Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Mon, 21 Sep 2015 09:09:29 -0700 Subject: [PATCH] Backed out changeset 49a711e67d8b (bug 1190379) for various android crashes CLOSED TREE --- .../platforms/android/AndroidDecoderModule.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/dom/media/platforms/android/AndroidDecoderModule.cpp b/dom/media/platforms/android/AndroidDecoderModule.cpp index 12c220f4e6cd..28e9b17112d7 100644 --- a/dom/media/platforms/android/AndroidDecoderModule.cpp +++ b/dom/media/platforms/android/AndroidDecoderModule.cpp @@ -19,6 +19,7 @@ #include "nsPromiseFlatString.h" #include +#include using namespace mozilla; using namespace mozilla::gl; @@ -33,21 +34,10 @@ namespace mozilla { NS_WARNING("callback not set"); \ } -static const char* TranslateMimeType(const nsACString& aMimeType) -{ - if (aMimeType.EqualsLiteral("video/webm; codecs=vp8")) { - return "video/x-vnd.on2.vp8"; - } else if (aMimeType.EqualsLiteral("video/webm; codecs=vp9")) { - return "video/x-vnd.on2.vp9"; - } - return PromiseFlatCString(aMimeType).get(); -} - static MediaCodec::LocalRef CreateDecoder(const nsACString& aMimeType) { MediaCodec::LocalRef codec; - NS_ENSURE_SUCCESS(MediaCodec::CreateDecoderByType(TranslateMimeType(aMimeType), - &codec), nullptr); + NS_ENSURE_SUCCESS(MediaCodec::CreateDecoderByType(PromiseFlatCString(aMimeType).get(), &codec), nullptr); return codec; } @@ -297,7 +287,7 @@ AndroidDecoderModule::CreateVideoDecoder( MediaFormat::LocalRef format; NS_ENSURE_SUCCESS(MediaFormat::CreateVideoFormat( - TranslateMimeType(aConfig.mMimeType), + aConfig.mMimeType, aConfig.mDisplay.width, aConfig.mDisplay.height, &format), nullptr);