27 lines
731 B
Diff
27 lines
731 B
Diff
--- a/dom/media/flac/FlacDecoder.cpp
|
|
+++ b/dom/media/flac/FlacDecoder.cpp
|
|
@@ -7,11 +7,22 @@
|
|
#include "FlacDecoder.h"
|
|
#include "MediaContainerType.h"
|
|
#include "mozilla/StaticPrefs_media.h"
|
|
+#include "PDMFactory.h"
|
|
|
|
namespace mozilla {
|
|
|
|
/* static */
|
|
-bool FlacDecoder::IsEnabled() { return StaticPrefs::media_flac_enabled(); }
|
|
+bool FlacDecoder::IsEnabled() {
|
|
+#ifdef MOZ_FFVPX
|
|
+ return StaticPrefs::media_flac_enabled();
|
|
+#elif defined(MOZ_FFVPX)
|
|
+ RefPtr<PDMFACTORY> platform = new PDMFactory();
|
|
+ return StaticPrefs::media_flac_enabled() &&
|
|
+ platform->SupportMimeType("audio/flac"_ns);
|
|
+#else
|
|
+ return false;
|
|
+#endif
|
|
+}
|
|
|
|
/* static */
|
|
bool FlacDecoder::IsSupportedType(const MediaContainerType& aContainerType) {
|