Changeset View
Changeset View
Standalone View
Standalone View
www/firefox/files/patch-dom_media_flac_FlacDecoder.cpp
Enable FLAC on platforms without ffvpx like powerpc* | Enable FLAC on platforms without ffvpx like powerpc* | ||||
diff --git dom/media/flac/FlacDecoder.cpp dom/media/flac/FlacDecoder.cpp | diff --git dom/media/flac/FlacDecoder.cpp dom/media/flac/FlacDecoder.cpp | ||||
index 53fc3c9937f7..b23771ab80fa 100644 | index 53fc3c9937f7..b23771ab80fa 100644 | ||||
--- dom/media/flac/FlacDecoder.cpp | --- dom/media/flac/FlacDecoder.cpp | ||||
+++ dom/media/flac/FlacDecoder.cpp | +++ dom/media/flac/FlacDecoder.cpp | ||||
@@ -7,6 +7,7 @@ | @@ -7,6 +7,7 @@ | ||||
#include "FlacDecoder.h" | #include "FlacDecoder.h" | ||||
#include "MediaContainerType.h" | #include "MediaContainerType.h" | ||||
#include "mozilla/StaticPrefs.h" | #include "mozilla/StaticPrefs_media.h" | ||||
+#include "PDMFactory.h" | +#include "PDMFactory.h" | ||||
namespace mozilla { | namespace mozilla { | ||||
@@ -14,6 +15,11 @@ namespace mozilla { | @@ -14,6 +15,11 @@ namespace mozilla { | ||||
bool FlacDecoder::IsEnabled() { | bool FlacDecoder::IsEnabled() { | ||||
#ifdef MOZ_FFVPX | #ifdef MOZ_FFVPX | ||||
return StaticPrefs::media_flac_enabled(); | return StaticPrefs::media_flac_enabled(); | ||||
+#elif defined(MOZ_FFMPEG) | +#elif defined(MOZ_FFMPEG) | ||||
+ RefPtr<PDMFactory> platform = new PDMFactory(); | + RefPtr<PDMFactory> platform = new PDMFactory(); | ||||
+ return StaticPrefs::media_flac_enabled() && | + return StaticPrefs::media_flac_enabled() && | ||||
+ platform->SupportsMimeType(NS_LITERAL_CSTRING("audio/flac"), | + platform->SupportsMimeType(NS_LITERAL_CSTRING("audio/flac"), | ||||
+ /* DecoderDoctorDiagnostics* */ nullptr); | + /* DecoderDoctorDiagnostics* */ nullptr); | ||||
#else | #else | ||||
// Until bug 1295886 is fixed. | // Until bug 1295886 is fixed. | ||||
return false; | return false; |