flac-no-ffvpx.patch 816 B

1234567891011121314151617181920212223242526
  1. Enable FLAC on platforms without ffvpx like powerpc*
  2. diff --git dom/media/flac/FlacDecoder.cpp dom/media/flac/FlacDecoder.cpp
  3. index 53fc3c9937f7..b23771ab80fa 100644
  4. --- a/dom/media/flac/FlacDecoder.cpp
  5. +++ b/dom/media/flac/FlacDecoder.cpp
  6. @@ -7,6 +7,7 @@
  7. #include "FlacDecoder.h"
  8. #include "MediaContainerType.h"
  9. #include "mozilla/StaticPrefs_media.h"
  10. +#include "PDMFactory.h"
  11. namespace mozilla {
  12. @@ -14,6 +15,10 @@ namespace mozilla {
  13. bool FlacDecoder::IsEnabled() {
  14. #ifdef MOZ_FFVPX
  15. return StaticPrefs::media_flac_enabled();
  16. +#elif defined(MOZ_FFMPEG)
  17. + RefPtr<PDMFactory> platform = new PDMFactory();
  18. + return StaticPrefs::media_flac_enabled() &&
  19. + platform->SupportsMimeType("audio/flac"_ns) != media::DecodeSupport::Unsupported;
  20. #else
  21. // Until bug 1295886 is fixed.
  22. return false;