summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Stransky <stransky@redhat.com>2020-10-19 21:01:34 +0200
committerMartin Stransky <stransky@redhat.com>2020-10-19 21:01:34 +0200
commit8e3365440adef7585f6a8bcabed3e82a3db5d5ca (patch)
treed1c26e4bc00b4a430b9bba2c9b5cdcd438319bda
parentAdded ELN build fixes (diff)
downloadlibrewolf-fedora-ff-8e3365440adef7585f6a8bcabed3e82a3db5d5ca.tar.gz
librewolf-fedora-ff-8e3365440adef7585f6a8bcabed3e82a3db5d5ca.tar.bz2
librewolf-fedora-ff-8e3365440adef7585f6a8bcabed3e82a3db5d5ca.zip
Updated openh264 patch to use keyframes from contained for openh264 only
-rw-r--r--firefox.spec4
-rw-r--r--mozilla-1670333.patch70
2 files changed, 66 insertions, 8 deletions
diff --git a/firefox.spec b/firefox.spec
index c35d6df..084f698 100644
--- a/firefox.spec
+++ b/firefox.spec
@@ -618,7 +618,9 @@ echo "ac_add_options MOZ_PGO=1" >> .mozconfig
# Temporary disabled due to GCC bug
# Fixed by https://bugzilla.mozilla.org/show_bug.cgi?id=1671345
# Should be in Firefox 83
-# echo "ac_add_options --enable-lto" >> .mozconfig
+%if 0%{?fedora} > 33
+echo "ac_add_options --enable-lto" >> .mozconfig
+%endif
# PGO build doesn't work with ccache
export CCACHE_DISABLE=1
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