Added fix for mozbz#1759137

This commit is contained in:
Martin Stransky 2022-05-03 09:54:03 +02:00
parent e4c24fcfb3
commit b311ef1fb8
2 changed files with 67 additions and 1 deletions

61
D145094.diff Normal file
View File

@ -0,0 +1,61 @@
diff -up firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.D145094 firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp
--- firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.D145094 2022-04-29 01:01:46.000000000 +0200
+++ firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp 2022-05-03 09:51:48.570471687 +0200
@@ -23,7 +23,7 @@ RefPtr<layers::Image> VideoFrameSurface<
VideoFrameSurface<LIBAV_VER>::VideoFrameSurface(DMABufSurface* aSurface)
: mSurface(aSurface),
mLib(nullptr),
- mAVHWDeviceContext(nullptr),
+ mAVHWFrameContext(nullptr),
mHWAVBuffer(nullptr) {
// Create global refcount object to track mSurface usage over
// gects rendering engine. We can't release it until it's used
@@ -38,16 +38,22 @@ VideoFrameSurface<LIBAV_VER>::VideoFrame
void VideoFrameSurface<LIBAV_VER>::LockVAAPIData(
AVCodecContext* aAVCodecContext, AVFrame* aAVFrame,
FFmpegLibWrapper* aLib) {
- FFMPEG_LOG("VideoFrameSurface: VAAPI locking dmabuf surface UID = %d",
- mSurface->GetUID());
+ MOZ_DIAGNOSTIC_ASSERT(aAVCodecContext->hw_frames_ctx);
mLib = aLib;
- mAVHWDeviceContext = aLib->av_buffer_ref(aAVCodecContext->hw_device_ctx);
+ mAVHWFrameContext = aLib->av_buffer_ref(aAVCodecContext->hw_frames_ctx);
mHWAVBuffer = aLib->av_buffer_ref(aAVFrame->buf[0]);
+ FFMPEG_LOG(
+ "VideoFrameSurface: VAAPI locking dmabuf surface UID = %d "
+ "mAVHWFrameContext %p mHWAVBuffer %p",
+ mSurface->GetUID(), mAVHWFrameContext, mHWAVBuffer);
}
void VideoFrameSurface<LIBAV_VER>::ReleaseVAAPIData(bool aForFrameRecycle) {
- FFMPEG_LOG("VideoFrameSurface: VAAPI releasing dmabuf surface UID = %d",
- mSurface->GetUID());
+ FFMPEG_LOG(
+ "VideoFrameSurface: VAAPI releasing dmabuf surface UID = %d "
+ "aForFrameRecycle %d mLib %p mAVHWFrameContext %p mHWAVBuffer %p",
+ mSurface->GetUID(), aForFrameRecycle, mLib, mAVHWFrameContext,
+ mHWAVBuffer);
// It's possible to unref GPU data while IsUsed() is still set.
// It can happens when VideoFramePool is deleted while decoder shutdown
@@ -57,7 +63,7 @@ void VideoFrameSurface<LIBAV_VER>::Relea
// is closed.
if (mLib) {
mLib->av_buffer_unref(&mHWAVBuffer);
- mLib->av_buffer_unref(&mAVHWDeviceContext);
+ mLib->av_buffer_unref(&mAVHWFrameContext);
}
// If we want to recycle the frame, make sure it's not used
diff -up firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.D145094 firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h
--- firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.D145094 2022-04-29 00:02:40.000000000 +0200
+++ firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h 2022-05-03 09:33:27.110885715 +0200
@@ -102,7 +102,7 @@ class VideoFrameSurface<LIBAV_VER> {
const RefPtr<DMABufSurface> mSurface;
const FFmpegLibWrapper* mLib;
- AVBufferRef* mAVHWDeviceContext;
+ AVBufferRef* mAVHWFrameContext;
AVBufferRef* mHWAVBuffer;
};

View File

@ -163,7 +163,7 @@ ExcludeArch: aarch64
Summary: Mozilla Firefox Web browser
Name: firefox
Version: 100.0
Release: 1%{?pre_tag}%{?dist}
Release: 2%{?pre_tag}%{?dist}
URL: https://www.mozilla.org/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+
Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz
@ -242,6 +242,7 @@ Patch402: mozilla-1196777.patch
Patch407: mozilla-1667096.patch
Patch408: mozilla-1663844.patch
Patch415: mozilla-1670333.patch
Patch416: D145094.diff
# PGO/LTO patches
Patch600: pgo.patch
@ -482,6 +483,7 @@ This package contains results of tests executed during build.
%patch407 -p1 -b .1667096
%patch408 -p1 -b .1663844
%patch415 -p1 -b .1670333
%patch416 -p1 -b .D145094
# PGO patches
%if %{build_with_pgo}
@ -1048,6 +1050,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#---------------------------------------------------------------------
%changelog
* Tue May 3 2022 Martin Stransky <stransky@redhat.com>- 100.0-2
- Added fix for mozbz#1759137
* Mon May 2 2022 Martin Stransky <stransky@redhat.com>- 100.0-1
- Updated to 100.0