fix build error of ffmpeg-6.1.1

This commit is contained in:
chenguanglee 2024-11-22 10:36:57 +08:00
parent 2960aa234b
commit fd44886af6
3 changed files with 98 additions and 2 deletions

View File

@ -0,0 +1,39 @@
From ce5bf37d858e399e9a114fcb147d924d6ace42a1 Mon Sep 17 00:00:00 2001
From: chenguanglee <lichenguang@kylinos.cn>
Date: Fri, 22 Nov 2024 10:20:05 +0800
Subject: [PATCH] fix build error of ffmpeg-6.1.1
---
src/core/ffutil.cpp | 2 +-
src/core/ffutil.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/core/ffutil.cpp b/src/core/ffutil.cpp
index 5297a31..082cb36 100644
--- a/src/core/ffutil.cpp
+++ b/src/core/ffutil.cpp
@@ -21,7 +21,7 @@ extern "C"
FFUtil::FFUtil(QObject *parent) : QObject(parent)
{
- av_register_all();
+ //av_register_all();
m_videoTbr = new VideoThumbnailer;
m_videoTbr->setThumbnailSize(176);
pFormatCtx = nullptr;
diff --git a/src/core/ffutil.h b/src/core/ffutil.h
index cf3de29..7517f27 100644
--- a/src/core/ffutil.h
+++ b/src/core/ffutil.h
@@ -26,7 +26,7 @@ private:
VideoThumbnailer *m_videoTbr;
AVFormatContext *pFormatCtx;
AVCodecContext *pCodecCtx;
- AVCodec *pCodec;
+ const AVCodec *pCodec;
int videoStream;
int videoDuration;
--
2.43.0

View File

@ -0,0 +1,49 @@
From 0194b2e2055335c50e2b4a040dc9af856c63c8e6 Mon Sep 17 00:00:00 2001
From: chenguanglee <lichenguang@kylinos.cn>
Date: Fri, 22 Nov 2024 10:27:18 +0800
Subject: [PATCH] remove MPV_EVENT_TRACK_SWITCHED case
---
src/core/mpvcore.cpp | 26 --------------------------
1 file changed, 26 deletions(-)
diff --git a/src/core/mpvcore.cpp b/src/core/mpvcore.cpp
index 378db64..fca822d 100644
--- a/src/core/mpvcore.cpp
+++ b/src/core/mpvcore.cpp
@@ -1627,32 +1627,6 @@ bool MpvCore::event(QEvent *event)
// mpv_event_log_message *message = static_cast<mpv_event_log_message*>(event->data);
break;
}
- case MPV_EVENT_TRACK_SWITCHED:
- KyInfo() << "[mpv event] MPV_EVENT_TRACK_SWITCHED";
- // 轨道id改变
- mpv_get_property(m_mpvHandle, "sid", MPV_FORMAT_INT64, &sid);
- if (sid > m_stracks)
- sid = 0;
-
- g_core_signal->notifySubId(sid);
- if(sid != m_sid && sid >= 0)
- {
- m_sid = sid;
- if (sid == 0) {
- ShowText(tr("subtitle : ").append("no"));
- }
- // 字幕改变
- for(Mpv::Track tck : m_fileInfo.stracks)
- if(tck.id == sid)
- ShowText(tr("subtitle : ").append(tck.title));
- }
- mpv_get_property(m_mpvHandle, "aid", MPV_FORMAT_INT64, &aid);
- g_core_signal->notifyAudioId(aid);
- mpv_get_property(m_mpvHandle, "vid", MPV_FORMAT_INT64, &vid);
- g_core_signal->notifyVideoId(vid);
- m_vid = vid;
- m_aid = aid;
- break;
default: // unhandled events
break;
}
--
2.43.0

View File

@ -1,12 +1,14 @@
Name: kylin-video
Version: 3.1.4
Release: 3
Release: 4
Summary: A powerful video player
License: GPL-2.0+
URL: https://gitee.com/openkylin/kylin-video
Source0: kylin-video-3.1.4.tar.gz
Patch01: 0001-fix-compile-error-of-kylin-video.patch
Patch01: 0001-fix-compile-error-of-kylin-video.patch
Patch02: 0002-Repair-the-user-guide-does-not-work.patch
Patch03: 0003-fix-build-error-of-ffmpeg-6.1.1.patch
Patch04: 0004-remove-MPV_EVENT_TRACK_SWITCHED-case.patch
BuildRequires: ffmpeg-devel
BuildRequires: libcrystalhd-devel
@ -41,6 +43,8 @@ It supports both x86 and ARM platform, and supports most of the audio and video
%setup -q
%patch01 -p1
%patch02 -p1
%patch03 -p1
%patch04 -p1
%build
mkdir qmake-build
@ -63,6 +67,10 @@ popd
%changelog
* Fri Nov 22 2024 lichenguang <lichenguang@kylinos.cn> - 3.1.4-4
- fix build error of ffmpeg-6.1.1
- fix build error of missing MPV_EVENT_TRACK_SWITCHED definition
* Mon Mar 06 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.4-3
- Repair the user guide does not work