diff --git a/0002-fix-build-error-of-kylin-recorder.patch b/0002-fix-build-error-of-kylin-recorder.patch new file mode 100644 index 0000000000000000000000000000000000000000..a01db3e3553fbd454ecaa7975a4bc22e3f9fff99 --- /dev/null +++ b/0002-fix-build-error-of-kylin-recorder.patch @@ -0,0 +1,63 @@ +From f30bed9e983be7aa406349db351442bb33b2c5f1 Mon Sep 17 00:00:00 2001 +From: peijiankang +Date: Fri, 29 Mar 2024 17:21:37 +0800 +Subject: [PATCH] fix build error of kylin-recorder + +--- + src/ffutil.cpp | 4 ++++ + src/ffutil.h | 9 ++++++++- + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/src/ffutil.cpp b/src/ffutil.cpp +index f824db5..2b0cd77 100644 +--- a/src/ffutil.cpp ++++ b/src/ffutil.cpp +@@ -17,14 +17,18 @@ extern "C" + + FFUtil::FFUtil(QObject *parent) : QObject(parent) + { ++#if !AVFORMAT_STATIC_REGISTER + av_register_all(); ++#endif + } + + int FFUtil::getDuration(QString path) + { + int64_t duration = 0; + ++#if !AVFORMAT_STATIC_REGISTER + av_register_all(); ++#endif + AVFormatContext *pFormatCtx = avformat_alloc_context(); + avformat_open_input(&pFormatCtx, path.toStdString().c_str(), NULL, NULL); + +diff --git a/src/ffutil.h b/src/ffutil.h +index 65461a5..12473a8 100644 +--- a/src/ffutil.h ++++ b/src/ffutil.h +@@ -3,6 +3,13 @@ + + #include + ++#define QTAV_USE_FFMPEG(MODULE) (MODULE##_VERSION_MICRO >= 100) ++#define QTAV_USE_LIBAV(MODULE) !QTAV_USE_FFMPEG(MODULE) ++#define FFMPEG_MODULE_CHECK(MODULE, MAJOR, MINOR, MICRO) \ ++ (QTAV_USE_FFMPEG(MODULE) && MODULE##_VERSION_INT >= AV_VERSION_INT(MAJOR, MINOR, MICRO)) ++ ++#define AVFORMAT_STATIC_REGISTER FFMPEG_MODULE_CHECK(LIBAVFORMAT, 58, 9, 100) ++ + struct AVCodec; + struct AVCodecContext; + struct AVFormatContext; +@@ -32,7 +39,7 @@ private: + AVOutputFormat *pOutputFormat = nullptr; + AVFormatContext *pFormatCtx = nullptr; + AVCodecContext *pCodecCtx = nullptr; +- AVCodec *pCodec = nullptr; ++ const AVCodec *pCodec = nullptr; + int audioStream; + int audioDuration; + +-- +2.25.1 + diff --git a/kylin-recorder.spec b/kylin-recorder.spec index 6be9a1b3d79042227b915f0b7fef46dfd4e6bfc7..98805545eccd6c0959fee4c921c3c086d51d5c25 100644 --- a/kylin-recorder.spec +++ b/kylin-recorder.spec @@ -1,11 +1,12 @@ Name: kylin-recorder Version: 1.3.0 -Release: 4 +Release: 5 Summary: kylin-recorder License: GPL-3.0-or-later URL: https://github.com/UbuntuKylin/kylin-recorder Source0: %{name}-%{version}.tar.gz Patch01: 0001-add-user-guide-for-kylin-recorder.patch +Patch02: 0002-fix-build-error-of-kylin-recorder.patch BuildRequires: qt5-qtbase-devel BuildRequires: qt5-qtscript-devel @@ -40,6 +41,7 @@ kylin-recording %prep %setup -q %patch01 -p1 +%patch02 -p1 %build @@ -66,6 +68,9 @@ popd %{_datadir}/kylin-user-guide/data/guide/kylin-recorder %changelog +* Fri Mar 29 2024 peijiankang - 1.3.0-5 +- add 0002-fix-build-error-of-kylin-recorder.patch + * Wed Mar 22 2023 peijiankang - 1.3.0-4 - fix user-guide for kylin-recorder in English