diff options
author | Martin Stransky <stransky@redhat.com> | 2022-05-03 09:54:03 +0200 |
---|---|---|
committer | Martin Stransky <stransky@redhat.com> | 2022-05-03 09:54:03 +0200 |
commit | b311ef1fb8696a5c5d6e9b34c32fdb0a6315a108 (patch) | |
tree | 8c9c81dd4fb39c20d61be6bc75fc5a2d479edf58 /D145094.diff | |
parent | Updated to 100.0 (diff) | |
download | librewolf-fedora-ff-b311ef1fb8696a5c5d6e9b34c32fdb0a6315a108.tar.gz librewolf-fedora-ff-b311ef1fb8696a5c5d6e9b34c32fdb0a6315a108.tar.bz2 librewolf-fedora-ff-b311ef1fb8696a5c5d6e9b34c32fdb0a6315a108.zip |
Added fix for mozbz#1759137
Diffstat (limited to 'D145094.diff')
-rw-r--r-- | D145094.diff | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/D145094.diff b/D145094.diff new file mode 100644 index 0000000..711acc9 --- /dev/null +++ b/D145094.diff @@ -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; + }; + |