summaryrefslogtreecommitdiff
path: root/mozilla-1670333.patch
diff options
context:
space:
mode:
Diffstat (limited to 'mozilla-1670333.patch')
-rw-r--r--mozilla-1670333.patch70
1 files changed, 63 insertions, 7 deletions
diff --git a/mozilla-1670333.patch b/mozilla-1670333.patch
index 42d42ba..a7c7f8a 100644
--- a/mozilla-1670333.patch
+++ b/mozilla-1670333.patch
@@ -1,12 +1,68 @@
-diff -up firefox-81.0.2/dom/media/mp4/MP4Demuxer.cpp.old firefox-81.0.2/dom/media/mp4/MP4Demuxer.cpp
---- firefox-81.0.2/dom/media/mp4/MP4Demuxer.cpp.old 2020-10-14 17:06:31.424309071 +0200
-+++ firefox-81.0.2/dom/media/mp4/MP4Demuxer.cpp 2020-10-14 17:07:31.029533759 +0200
-@@ -394,7 +394,7 @@ already_AddRefed<MediaRawData> MP4TrackD
+diff -up firefox-82.0/dom/media/mp4/MP4Demuxer.cpp.1670333 firefox-82.0/dom/media/mp4/MP4Demuxer.cpp
+--- firefox-82.0/dom/media/mp4/MP4Demuxer.cpp.1670333 2020-10-14 19:20:18.000000000 +0200
++++ firefox-82.0/dom/media/mp4/MP4Demuxer.cpp 2020-10-19 20:56:38.362039524 +0200
+@@ -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 (sample->mKeyframe != keyframe) {
-+ if (sample->mKeyframe && sample->mKeyframe != keyframe) {
++ 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
- " dts:%" PRId64,
+diff -up firefox-82.0/dom/media/platforms/PDMFactory.cpp.1670333 firefox-82.0/dom/media/platforms/PDMFactory.cpp
+--- firefox-82.0/dom/media/platforms/PDMFactory.cpp.1670333 2020-10-14 19:20:18.000000000 +0200
++++ firefox-82.0/dom/media/platforms/PDMFactory.cpp 2020-10-19 20:53:14.631214334 +0200
+@@ -49,6 +49,8 @@
+
+ #include <functional>
+
++bool gUseKeyframeFromContainer = false;
++
+ namespace mozilla {
+
+ extern already_AddRefed<PlatformDecoderModule> CreateBlankDecoderModule();
+@@ -380,7 +382,8 @@ void PDMFactory::CreatePDMs() {
+ #ifdef MOZ_FFMPEG
+ if (StaticPrefs::media_ffmpeg_enabled()) {
+ m = FFmpegRuntimeLinker::CreateDecoderModule();
+- mFFmpegFailedToLoad = !StartupPDM(m);
++ mFFmpegUsed = StartupPDM(m);
++ mFFmpegFailedToLoad = !mFFmpegUsed;
+ } else {
+ mFFmpegFailedToLoad = false;
+ }
+@@ -395,7 +398,8 @@ void PDMFactory::CreatePDMs() {
+ m = new AgnosticDecoderModule();
+ StartupPDM(m);
+
+- if (StaticPrefs::media_gmp_decoder_enabled()) {
++ if (StaticPrefs::media_gmp_decoder_enabled() && !mFFmpegUsed) {
++ gUseKeyframeFromContainer = true;
+ m = new GMPDecoderModule();
+ mGMPPDMFailedToStartup = !StartupPDM(m);
+ } else {
+diff -up firefox-82.0/dom/media/platforms/PDMFactory.h.1670333 firefox-82.0/dom/media/platforms/PDMFactory.h
+--- firefox-82.0/dom/media/platforms/PDMFactory.h.1670333 2020-10-14 19:20:18.000000000 +0200
++++ firefox-82.0/dom/media/platforms/PDMFactory.h 2020-10-19 20:53:14.631214334 +0200
+@@ -70,6 +70,7 @@ class PDMFactory final {
+
+ bool mWMFFailedToLoad = false;
+ bool mFFmpegFailedToLoad = false;
++ bool mFFmpegUsed = false;
+ bool mGMPPDMFailedToStartup = false;
+
+ friend class RemoteVideoDecoderParent;
bgstack15