37 lines
1.0 KiB
Diff
37 lines
1.0 KiB
Diff
From 58b0385412c6d96eb745e2fc5902df347e629f6d Mon Sep 17 00:00:00 2001
|
|
From: Thomas Deutschmann <whissi@gentoo.org>
|
|
Date: Thu, 29 Apr 2021 18:48:06 +0200
|
|
Subject: [PATCH 28/30] Enable FLAC on platforms without ffvpx via ffmpeg
|
|
|
|
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
|
|
---
|
|
dom/media/flac/FlacDecoder.cpp | 5 +++++
|
|
1 file changed, 5 insertions(+)
|
|
|
|
diff --git a/dom/media/flac/FlacDecoder.cpp b/dom/media/flac/FlacDecoder.cpp
|
|
index 2f205c9aae..68847b0952 100644
|
|
--- a/dom/media/flac/FlacDecoder.cpp
|
|
+++ b/dom/media/flac/FlacDecoder.cpp
|
|
@@ -7,6 +7,7 @@
|
|
#include "FlacDecoder.h"
|
|
#include "MediaContainerType.h"
|
|
#include "mozilla/StaticPrefs_media.h"
|
|
+#include "PDMFactory.h"
|
|
|
|
namespace mozilla {
|
|
|
|
@@ -14,6 +15,10 @@ namespace mozilla {
|
|
bool FlacDecoder::IsEnabled() {
|
|
#ifdef MOZ_FFVPX
|
|
return StaticPrefs::media_flac_enabled();
|
|
+#elif defined(MOZ_FFMPEG)
|
|
+ RefPtr<PDMFactory> platform = new PDMFactory();
|
|
+ return StaticPrefs::media_flac_enabled() &&
|
|
+ platform->SupportsMimeType("audio/flac"_ns);
|
|
#else
|
|
return false;
|
|
#endif
|
|
--
|
|
2.34.1
|
|
|