From fcca5b12024e1f8967a6265b1fe5182795225d2d Mon Sep 17 00:00:00 2001 From: DuanRay Date: Wed, 18 Oct 2023 13:34:51 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=B0=83=E6=95=B4mpv=E9=80=89?= =?UTF-8?q?=E9=A1=B9=EF=BC=8C=E4=BB=A5=E5=85=BC=E5=AE=B9=E9=AB=98=E4=BD=8E?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=9A=84mpv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...atible-with-high-and-low-mpv-version.patch | 32 +++++++++++++++++++ nfs-mplayer.spec | 6 +++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 0010-adjust-mpv-options-compatible-with-high-and-low-mpv-version.patch diff --git a/0010-adjust-mpv-options-compatible-with-high-and-low-mpv-version.patch b/0010-adjust-mpv-options-compatible-with-high-and-low-mpv-version.patch new file mode 100644 index 0000000..a1fe426 --- /dev/null +++ b/0010-adjust-mpv-options-compatible-with-high-and-low-mpv-version.patch @@ -0,0 +1,32 @@ +diff --git a/nfs-mplayer-1.0.0/src/mpvoptions.cpp b/nfs-mplayer-1.0.0/src/mpvoptions.cpp +index 0e9d66f..ab9e3da 100755 +--- a/nfs-mplayer-1.0.0/src/mpvoptions.cpp ++++ b/nfs-mplayer-1.0.0/src/mpvoptions.cpp +@@ -167,14 +167,19 @@ void MPVProcess::enableScreenshots(const QString & dir, const QString & templ, c + } + + void MPVProcess::setOption(const QString & option_name, const QVariant & value) { +- if (option_name == "cache") { +- int cache = value.toInt(); +- if (cache > 31) { +- arg << "--cache=" + value.toString(); +- } else { +- arg << "--cache=no"; +- } +- } ++ if(option_name == "cache"){ ++ int cache = value.toInt(); ++ if (cache > 31) { ++ if (isOptionAvailable("--demuxer-max-bytes")) { ++ int byte = value.toString().toInt() * 1024; ++ arg << "--demuxer-max-bytes=" << QString::number(bytes); ++ }else { ++ arg << "--cache=" + value.toString(); ++ } ++ } else { ++ arg << "--cache=no"; ++ } ++ } + else + if (option_name == "cache_auto") { + arg << "--cache=auto"; diff --git a/nfs-mplayer.spec b/nfs-mplayer.spec index 98fc3f1..ede68ca 100644 --- a/nfs-mplayer.spec +++ b/nfs-mplayer.spec @@ -1,6 +1,6 @@ Name: nfs-mplayer Version: 1.0.0 -Release: 10%{?dist} +Release: 11%{?dist} Summary: A great media player Group: Applications/Multimedia License: GPLv2+ @@ -14,6 +14,7 @@ Patch5: 0006-fix-file-operation-will-pause-video-play.patch Patch6: 0007-show-main-menu-in-max-mode.patch Patch7: 0008-fix-draging-flickering-when-resizing.patch Patch8: 0009-fix-window-resizing-error-cannot-capture-mouse-release.patch +Patch9: 0010-adjust-mpv-options-compatible-with-high-and-low-mpv-version.patch %if 0%{?suse_version} BuildRequires: hicolor-icon-theme @@ -114,6 +115,9 @@ update-desktop-database &> /dev/null || : %changelog +* Wed Oct 18 2023 ruizhe - 1.0.0-11 +- Adjust mpv options compatible with high and low mpv version + * Wed Oct 18 2023 ruizhe - 1.0.0-10 - Fix window resizing error cannot capture mouse release -- Gitee