qtscrcpy: switch to latest ffmpeg

This commit is contained in:
aleksana 2024-11-20 23:01:59 +08:00
parent 1b68d687ec
commit fffbbb85bb
2 changed files with 22 additions and 2 deletions

View File

@ -7,7 +7,7 @@
libsForQt5, libsForQt5,
scrcpy, scrcpy,
android-tools, android-tools,
ffmpeg_4, ffmpeg,
makeDesktopItem, makeDesktopItem,
copyDesktopItems, copyDesktopItems,
}: }:
@ -37,6 +37,11 @@ stdenv.mkDerivation rec {
# remove predefined adb and scrcpy-server path # remove predefined adb and scrcpy-server path
# we later set them in wrapper # we later set them in wrapper
./remove_predefined_paths.patch ./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 = '' postPatch = ''
@ -61,7 +66,8 @@ stdenv.mkDerivation rec {
buildInputs = buildInputs =
[ [
scrcpy scrcpy
ffmpeg_4 # Upstream vendors ffmpeg_4
ffmpeg
] ]
++ (with libsForQt5; [ ++ (with libsForQt5; [
qtbase qtbase

View File

@ -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);
}