From fffbbb85bb255c97005ae4a94e0a754addf443f9 Mon Sep 17 00:00:00 2001 From: aleksana Date: Wed, 20 Nov 2024 23:01:59 +0800 Subject: [PATCH] qtscrcpy: switch to latest ffmpeg --- pkgs/by-name/qt/qtscrcpy/package.nix | 10 ++++++++-- .../remove_deprecated_avcodec_free_context.patch | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 pkgs/by-name/qt/qtscrcpy/remove_deprecated_avcodec_free_context.patch diff --git a/pkgs/by-name/qt/qtscrcpy/package.nix b/pkgs/by-name/qt/qtscrcpy/package.nix index 88f13a04d03a..3d9d733de46d 100644 --- a/pkgs/by-name/qt/qtscrcpy/package.nix +++ b/pkgs/by-name/qt/qtscrcpy/package.nix @@ -7,7 +7,7 @@ libsForQt5, scrcpy, android-tools, - ffmpeg_4, + ffmpeg, makeDesktopItem, copyDesktopItems, }: @@ -37,6 +37,11 @@ stdenv.mkDerivation rec { # remove predefined adb and scrcpy-server path # we later set them in wrapper ./remove_predefined_paths.patch + + # remove avcodec_close which is deprecated in ffmpeg_7 + # This doesn't affect functionality because + # it's followed by avcodec_free_context + ./remove_deprecated_avcodec_free_context.patch ]; postPatch = '' @@ -61,7 +66,8 @@ stdenv.mkDerivation rec { buildInputs = [ scrcpy - ffmpeg_4 + # Upstream vendors ffmpeg_4 + ffmpeg ] ++ (with libsForQt5; [ qtbase diff --git a/pkgs/by-name/qt/qtscrcpy/remove_deprecated_avcodec_free_context.patch b/pkgs/by-name/qt/qtscrcpy/remove_deprecated_avcodec_free_context.patch new file mode 100644 index 000000000000..4037144d3bf9 --- /dev/null +++ b/pkgs/by-name/qt/qtscrcpy/remove_deprecated_avcodec_free_context.patch @@ -0,0 +1,14 @@ +diff --git a/src/device/decoder/decoder.cpp b/src/device/decoder/decoder.cpp +index 79dec15..5f6979b 100644 +--- a/src/device/decoder/decoder.cpp ++++ b/QtScrcpy/QtScrcpyCore/src/device/decoder/decoder.cpp +@@ -51,9 +51,6 @@ void Decoder::close() + if (!m_codecCtx) { + return; + } +- if (m_isCodecCtxOpen) { +- avcodec_close(m_codecCtx); +- } + avcodec_free_context(&m_codecCtx); + } +