firefox/mozilla-1670333.patch

75 lines
3.0 KiB
Diff
Raw Normal View History

2021-03-23 09:29:22 +00:00
diff -up firefox-87.0/dom/media/mp4/MP4Demuxer.cpp.1670333 firefox-87.0/dom/media/mp4/MP4Demuxer.cpp
--- firefox-87.0/dom/media/mp4/MP4Demuxer.cpp.1670333 2021-03-18 14:48:35.000000000 +0100
+++ firefox-87.0/dom/media/mp4/MP4Demuxer.cpp 2021-03-22 20:05:43.862198652 +0100
@@ -31,6 +31,8 @@ mozilla::LogModule* GetDemuxerLog() { re
DDMOZ_LOG(gMediaDemuxerLog, mozilla::LogLevel::Debug, "::%s: " arg, \
__func__, ##__VA_ARGS__)
+extern bool gUseKeyframeFromContainer;
+
namespace mozilla {
DDLoggedTypeDeclNameAndBase(MP4TrackDemuxer, MediaTrackDemuxer);
@@ -394,6 +396,12 @@ already_AddRefed<MediaRawData> MP4TrackD
[[fallthrough]];
case H264::FrameType::OTHER: {
bool keyframe = type == H264::FrameType::I_FRAME;
+ if (gUseKeyframeFromContainer) {
+ if (sample->mKeyframe && sample->mKeyframe != keyframe) {
+ sample->mKeyframe = keyframe;
+ }
+ break;
+ }
if (sample->mKeyframe != keyframe) {
NS_WARNING(nsPrintfCString("Frame incorrectly marked as %skeyframe "
"@ pts:%" PRId64 " dur:%" PRId64
2021-03-23 09:29:22 +00:00
diff -up firefox-87.0/dom/media/platforms/PDMFactory.cpp.1670333 firefox-87.0/dom/media/platforms/PDMFactory.cpp
--- firefox-87.0/dom/media/platforms/PDMFactory.cpp.1670333 2021-03-18 14:48:35.000000000 +0100
+++ firefox-87.0/dom/media/platforms/PDMFactory.cpp 2021-03-22 20:08:35.850255636 +0100
@@ -58,6 +58,8 @@
#include <functional>
+bool gUseKeyframeFromContainer = false;
+
namespace mozilla {
2021-03-23 09:29:22 +00:00
#define PDM_INIT_LOG(msg, ...) \
@@ -558,9 +560,11 @@ void PDMFactory::CreateDefaultPDMs() {
2020-12-10 19:02:09 +00:00
}
#endif
#ifdef MOZ_FFMPEG
2020-12-10 19:02:09 +00:00
- if (StaticPrefs::media_ffmpeg_enabled() &&
- !CreateAndStartupPDM<FFmpegRuntimeLinker>()) {
- mFailureFlags += DecoderDoctorDiagnostics::Flags::FFmpegFailedToLoad;
+ if (StaticPrefs::media_ffmpeg_enabled()) {
+ mFFmpegUsed = CreateAndStartupPDM<FFmpegRuntimeLinker>();
+ if (!mFFmpegUsed) {
+ mFailureFlags += DecoderDoctorDiagnostics::Flags::FFmpegFailedToLoad;
+ }
}
2020-12-10 19:02:09 +00:00
#endif
#ifdef MOZ_WIDGET_ANDROID
2021-03-23 09:29:22 +00:00
@@ -572,8 +576,9 @@ void PDMFactory::CreateDefaultPDMs() {
2020-12-10 19:02:09 +00:00
CreateAndStartupPDM<AgnosticDecoderModule>();
2020-12-10 19:02:09 +00:00
- if (StaticPrefs::media_gmp_decoder_enabled() &&
+ if (StaticPrefs::media_gmp_decoder_enabled() && !mFFmpegUsed &&
!CreateAndStartupPDM<GMPDecoderModule>()) {
+ gUseKeyframeFromContainer = true;
2020-12-10 19:02:09 +00:00
mFailureFlags += DecoderDoctorDiagnostics::Flags::GMPPDMFailedToStartup;
}
}
2021-03-23 09:29:22 +00:00
diff -up firefox-87.0/dom/media/platforms/PDMFactory.h.1670333 firefox-87.0/dom/media/platforms/PDMFactory.h
--- firefox-87.0/dom/media/platforms/PDMFactory.h.1670333 2021-03-22 20:05:43.862198652 +0100
+++ firefox-87.0/dom/media/platforms/PDMFactory.h 2021-03-22 20:08:17.705722130 +0100
@@ -120,6 +120,7 @@ class PDMFactory final {
RefPtr<PlatformDecoderModule> mNullPDM;
2020-12-10 19:02:09 +00:00
DecoderDoctorDiagnostics::FlagsSet mFailureFlags;
+ bool mFFmpegUsed = false;
2021-03-23 09:29:22 +00:00
friend class RemoteVideoDecoderParent;
2020-12-10 19:02:09 +00:00
static void EnsureInit();