<pre style='margin:0'>
Perry E. Metzger (pmetzger) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/59f2575a0a73033b83ccea42a86f228a399a19bf">https://github.com/macports/macports-ports/commit/59f2575a0a73033b83ccea42a86f228a399a19bf</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 59f2575a0a7 QMPlay2: new port in multimedia, Qt-based player
</span>59f2575a0a7 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 59f2575a0a73033b83ccea42a86f228a399a19bf
</span>Author: barracuda156 <vital.had@gmail.com>
AuthorDate: Mon Dec 25 17:15:16 2023 +0800
<span style='display:block; white-space:pre;color:#404040;'> QMPlay2: new port in multimedia, Qt-based player
</span>---
multimedia/QMPlay2/Portfile | 146 +++
.../files/0001-macOS-unbreak-build-with-Qt4.patch | 44 +
...dget-fix-for-missing-qt_mac_set_dock_menu.patch | 21 +
.../files/0003-ScreenSaver-fix-IOKit-defines.patch | 20 +
.../files/0004-PlayClass-do-not-use-QRawFont.patch | 49 +
.../files/0005-Revert-some-broken-code.patch | 512 +++++++++++
...Mpeg-fix-compatibility-with-modern-FFMpeg.patch | 994 +++++++++++++++++++++
multimedia/QMPlay2/files/0007-Fix-Qt-paths.patch | 41 +
multimedia/QMPlay2/files/2001-Fix-Qt-paths.patch | 47 +
9 files changed, 1874 insertions(+)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/multimedia/QMPlay2/Portfile b/multimedia/QMPlay2/Portfile
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..75323abd2eb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/multimedia/QMPlay2/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,146 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+PortSystem 1.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+PortGroup github 1.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+PortGroup cmake 1.1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+name QMPlay2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {${os.platform} eq "darwin" && ${os.major} < 11} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PortGroup qt4 1.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ github.setup zaps166 QMPlay2 b76e6ea46b4a32bb2becc9444ddc6f5fdff699cd
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ version 18.12.08
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ revision 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ checksums rmd160 721638bc3641199387ec5e371dd22ddabe3a1c92 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha256 2f1f9af17e7a0dd0ce6a12eb35f425cbc43b6869cb9a32bedfef3cca70908bc6 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size 1228156
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ github.tarball_from archive
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patchfiles-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0001-macOS-unbreak-build-with-Qt4.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0002-MainWidget-fix-for-missing-qt_mac_set_dock_menu.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0003-ScreenSaver-fix-IOKit-defines.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0004-PlayClass-do-not-use-QRawFont.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0005-Revert-some-broken-code.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0006-FFMpeg-fix-compatibility-with-modern-FFMpeg.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0007-Fix-Qt-paths.patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.args-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DDEFAULT_QT5=OFF \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_JEMALLOC=OFF \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_OPENGL2=OFF \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_TEKSTOWO=ON \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_FFMPEG_VTB=OFF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ compiler.cxx_standard 2011
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ post-destroot {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system "install_name_tool -id ${applications_dir}/${name}.app/Contents/MacOS/libqmplay2.dylib \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${destroot}${applications_dir}/${name}.app/Contents/MacOS/libqmplay2.dylib"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system "install_name_tool -change ${prefix}/lib/libqmplay2.dylib \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${applications_dir}/${name}.app/Contents/MacOS/libqmplay2.dylib \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${destroot}${applications_dir}/${name}.app/Contents/MacOS/QMPlay2"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach dylib [ exec find ${destroot}${applications_dir}/${name}.app/Contents/MacOS/modules -name "\*.dylib" ] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ regsub ":$" ${dylib} "" destroot_dylib_path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ regsub ${destroot} ${destroot_dylib_path} "" dylib_path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system "install_name_tool -id ${dylib_path} ${destroot_dylib_path}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system "install_name_tool -change ${prefix}/lib/libqmplay2.dylib ${applications_dir}/${name}.app/Contents/MacOS/libqmplay2.dylib \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${destroot_dylib_path}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ variant jemalloc description "Use Jemalloc" {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_lib-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:jemalloc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.args-replace \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_JEMALLOC=OFF -DUSE_JEMALLOC=ON
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+} else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PortGroup qt5 1.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ qt5.depends_component qtdeclarative qttools qttranslations
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ github.setup zaps166 QMPlay2 23.10.22
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ revision 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ checksums rmd160 8a4c9db6811e577ebeae5c40c279fd64f550ece2 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha256 d81c5a81a8839ac441eb7466eb16931aab92f71fd784a3b3e1d709272c4237cf \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size 1442072
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ github.tarball_from releases
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ distname ${name}-src-${version}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ use_xz yes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patchfiles-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 2001-Fix-Qt-paths.patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.args-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DCMAKE_LINK_DEPENDS_NO_SHARED=OFF \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DSET_INSTALL_RPATH=OFF \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_LYRICS=ON \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_OPENGL=ON \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_RUBBERBAND=ON \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_UPDATES=OFF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_lib-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:rubberband
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ compiler.cxx_standard 2014
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ post-destroot {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system "install_name_tool -id ${applications_dir}/${name}.app/Contents/MacOS/libqmplay2.dylib \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${destroot}${applications_dir}/${name}.app/Contents/MacOS/libqmplay2.dylib"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system "install_name_tool -change ${prefix}/lib/libqmplay2.dylib \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${applications_dir}/${name}.app/Contents/MacOS/libqmplay2.dylib \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${destroot}${applications_dir}/${name}.app/Contents/MacOS/QMPlay2"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach so [ exec find ${destroot}${applications_dir}/${name}.app/Contents/MacOS/modules -name "\*.so" ] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ regsub ":$" ${so} "" destroot_so_path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ regsub ${destroot} ${destroot_so_path} "" so_path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system "install_name_tool -id ${so_path} ${destroot_so_path}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system "install_name_tool -change ${prefix}/lib/libqmplay2.dylib ${applications_dir}/${name}.app/Contents/MacOS/libqmplay2.dylib \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${destroot_so_path}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+categories multimedia
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+license LGPL-3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+maintainers {@barracuda156 gmail.com:vital.had} openmaintainer
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+description Qt Media Player 2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+long_description QMPlay2 is a video and audio player. It can play all formats supported by FFmpeg, \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ libmodplug (including J2B and SFX). It also supports Audio CD, raw files, \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Rayman 2 music and chiptunes. It contains YouTube and Prostopleer browser.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+depends_lib-append path:lib/libavcodec.dylib:ffmpeg \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:libass \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:libcddb \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:libcdio \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:portaudio \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:taglib \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:zlib
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+post-patch {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace "s|@destroot@|${destroot}|" ${worksrcpath}/src/gui/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace "s|@prefix@|${prefix}|g" ${worksrcpath}/src/gui/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace "s|@qt_libs_dir@|${qt_libs_dir}|" ${worksrcpath}/src/gui/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace "s|@qt_plugins_dir@|${qt_plugins_dir}|" ${worksrcpath}/src/gui/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+configure.args-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DCMAKE_INSTALL_PREFIX=${applications_dir} \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_ALSA=OFF \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_AUDIOCD=ON \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_FFMPEG=ON \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_LASTFM=ON \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_LIBASS=ON \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_PORTAUDIO=ON \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_PULSEAUDIO=OFF \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_TAGLIB=ON \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_VISUALIZATIONS=OFF \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_XVIDEO=OFF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+variant pulse description "Use Pulseaudio" {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_lib-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:pulseaudio
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.args-replace \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DUSE_PULSEAUDIO=OFF -DUSE_PULSEAUDIO=ON
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/multimedia/QMPlay2/files/0001-macOS-unbreak-build-with-Qt4.patch b/multimedia/QMPlay2/files/0001-macOS-unbreak-build-with-Qt4.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..480272dc7b2
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/multimedia/QMPlay2/files/0001-macOS-unbreak-build-with-Qt4.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,44 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 77720103a0c98bacb6c5e870d8365607e09c90cd Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: barracuda156 <vital.had@gmail.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Sat, 23 Dec 2023 20:48:46 +0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH] macOS: unbreak build with Qt4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/qmplay2/CMakeLists.txt src/qmplay2/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index c41de094..d29382cd 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/qmplay2/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/qmplay2/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -131,10 +131,12 @@ if(USE_FREEDESKTOP_NOTIFICATIONS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_definitions(-DNOTIFIES_FREEDESKTOP)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ elseif(APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(USE_QT5)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ list(APPEND QMPLAY2_HDR headers/NotifiesMacOS.hpp)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ list(APPEND QMPLAY2_SRC NotifiesMacOS.mm)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ find_package(Qt5MacExtras REQUIRED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_definitions(-DNOTIFIES_MACOS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set(QMPLAY2_RESOURCES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/qmplay2/QMPlay2Core.cpp src/qmplay2/QMPlay2Core.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index dd3f2a38..264bf055 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/qmplay2/QMPlay2Core.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/qmplay2/QMPlay2Core.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -36,7 +36,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if defined Q_OS_WIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <windows.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <powrprof.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif defined Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif defined Q_OS_MAC && (QT_VERSION > QT_VERSION_CHECK(5, 0, 0))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <QStandardPaths>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -179,7 +179,7 @@ void QMPlay2CoreClass::init(bool loadModules, bool modulesInSubdirs, const QStri
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if defined(Q_OS_WIN)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ settingsDir = QFileInfo(QSettings(QSettings::IniFormat, QSettings::UserScope, QString()).fileName()).absolutePath() + "/QMPlay2/";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif defined(Q_OS_MAC)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif defined(Q_OS_MAC) && (QT_VERSION > QT_VERSION_CHECK(5, 0, 0))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ settingsDir = Functions::cleanPath(QStandardPaths::standardLocations(QStandardPaths::DataLocation).value(0, settingsDir));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ settingsDir = QDir::homePath() + "/.qmplay2/";
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/multimedia/QMPlay2/files/0002-MainWidget-fix-for-missing-qt_mac_set_dock_menu.patch b/multimedia/QMPlay2/files/0002-MainWidget-fix-for-missing-qt_mac_set_dock_menu.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..c2dd30eb61c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/multimedia/QMPlay2/files/0002-MainWidget-fix-for-missing-qt_mac_set_dock_menu.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,21 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 6cfe82de3c20d4964850f2c4a06218d10c7fe255 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Sergey Fedorov <vital.had@gmail.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Mon, 25 Dec 2023 12:58:12 +0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH] MainWidget: fix for missing qt_mac_set_dock_menu
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/gui/MainWidget.cpp src/gui/MainWidget.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 6a046803..73b52bbb 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/gui/MainWidget.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/gui/MainWidget.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -68,6 +68,11 @@ using Functions::timeToStr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <SubsDec.hpp>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <IPC.hpp>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <Carbon/Carbon.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++extern void qt_mac_set_dock_menu(QMenu *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <cmath>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if QT_VERSION >= 0x050000 && defined Q_OS_WIN
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/multimedia/QMPlay2/files/0003-ScreenSaver-fix-IOKit-defines.patch b/multimedia/QMPlay2/files/0003-ScreenSaver-fix-IOKit-defines.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..a830e861543
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/multimedia/QMPlay2/files/0003-ScreenSaver-fix-IOKit-defines.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,20 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From a138dabfada74bbfab348afc6fdfb20759dc7551 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Sergey Fedorov <vital.had@gmail.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Mon, 25 Dec 2023 15:24:54 +0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH] ScreenSaver: fix IOKit defines
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/gui/macOS/ScreenSaver.cpp src/gui/macOS/ScreenSaver.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index de305ff9..13a22ac2 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/gui/macOS/ScreenSaver.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/gui/macOS/ScreenSaver.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -32,8 +32,8 @@ public:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ inline void inhibit()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- m_okDisp = (IOPMAssertionCreateWithName(kIOPMAssertPreventUserIdleDisplaySleep, kIOPMAssertionLevelOn, QMPLAY2_MEDIA_PLAYBACK, &m_idDisp) == kIOReturnSuccess);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- m_okSys = (IOPMAssertionCreateWithName(kIOPMAssertPreventUserIdleSystemSleep, kIOPMAssertionLevelOn, QMPLAY2_MEDIA_PLAYBACK, &m_idSys) == kIOReturnSuccess);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ m_okDisp = (IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, QMPLAY2_MEDIA_PLAYBACK, &m_idDisp) == kIOReturnSuccess);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ m_okSys = (IOPMAssertionCreateWithName(kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, QMPLAY2_MEDIA_PLAYBACK, &m_idSys) == kIOReturnSuccess);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ inline void unInhibit()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/multimedia/QMPlay2/files/0004-PlayClass-do-not-use-QRawFont.patch b/multimedia/QMPlay2/files/0004-PlayClass-do-not-use-QRawFont.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..effa2df65ae
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/multimedia/QMPlay2/files/0004-PlayClass-do-not-use-QRawFont.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,49 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 67eaa5620d7a2cd063180ace8897b909dde8549e Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Sergey Fedorov <vital.had@gmail.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Mon, 25 Dec 2023 13:01:48 +0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH] PlayClass: do not use QRawFont
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/gui/PlayClass.cpp src/gui/PlayClass.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index bcf802ff..21cfee5d 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/gui/PlayClass.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/gui/PlayClass.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -33,7 +33,18 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <Decoder.hpp>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <Reader.hpp>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if QT_VERSION >= 0x050000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #define USE_QRAWFONT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <QCoreApplication>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef USE_QRAWFONT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #include <QRawFont>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #include <QFontDatabase>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <QInputDialog>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <QMessageBox>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <QTextCodec>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -384,9 +395,20 @@ void PlayClass::loadSubsFile(const QString &fileName)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const QByteArray fontData = f.readAll();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ f.close();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef USE_QRAWFONT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const QString fontName = QRawFont(fontData, 0.0).familyName();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!fontName.isEmpty())
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ass->addFont(fontName.toUtf8(), fontData);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else // For Qt older than 5.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const int fontID = QFontDatabase::addApplicationFontFromData(fontData);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (fontID != -1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const QStringList fontFamilies = QFontDatabase::applicationFontFamilies(fontID);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ QFontDatabase::removeApplicationFont(fontID);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!fontFamilies.isEmpty())
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ass->addFont(fontFamilies.first().toUtf8(), fontData);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/multimedia/QMPlay2/files/0005-Revert-some-broken-code.patch b/multimedia/QMPlay2/files/0005-Revert-some-broken-code.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..96fae582dca
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/multimedia/QMPlay2/files/0005-Revert-some-broken-code.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,512 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From b99c6de26ff7177aa6e845b31dff24fe0fca34ee Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: barracuda156 <vital.had@gmail.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Sat, 23 Dec 2023 20:50:50 +0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH] Revert some broken code
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+FIXME: This likely can be improved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/gui/CMakeLists.txt src/gui/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index c8e77f8b..1ee4f913 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/gui/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/gui/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -124,7 +124,7 @@ if(USE_TAGLIB)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ list(APPEND GUI_SRC TagEditor.cpp)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-if(NOT APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++if(APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_definitions(-DQMPLAY2_ALLOW_ONLY_ONE_INSTANCE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/gui/Main.cpp src/gui/Main.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index d0e235b8..3aa66874 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/gui/Main.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/gui/Main.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -42,9 +42,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if QT_VERSION < 0x050000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <QTextCodec>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #include <QProcess>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <csignal>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <ctime>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -52,10 +49,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static QPair<QStringList, QStringList> g_arguments;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static ScreenSaver *g_screenSaver = nullptr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static bool g_useGui = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- static QByteArray g_rcdPath("/System/Library/LaunchAgents/com.apple.rcd.plist");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- static bool g_rcdLoad;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /**/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -312,17 +305,8 @@ static bool writeToSocket(IPCSocket &socket)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static inline void exitProcedure()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static inline void unInhibitScreenSaver()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (g_rcdLoad)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Load RCD service again (allow to run iTunes on "Play" key)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QProcess::startDetached("launchctl load " + g_rcdPath);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- g_rcdLoad = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ delete g_screenSaver;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ g_screenSaver = nullptr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -342,12 +326,12 @@ static inline void forceKill()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int s = SIGKILL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- exitProcedure();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ unInhibitScreenSaver();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ raise(s);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static inline void callDefaultSignalHandler(int s)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- exitProcedure();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ unInhibitScreenSaver();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ signal(s, SIG_DFL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ raise(s);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -454,7 +438,7 @@ int main(int argc, char *argv[])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ signal(SIGSEGV, signal_handler);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ signal(SIGTERM, signal_handler);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- atexit(exitProcedure);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ atexit(unInhibitScreenSaver);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if (defined(Q_OS_MAC) || defined(Q_OS_WIN)) && (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -585,16 +569,6 @@ int main(int argc, char *argv[])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ HHOOK keyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, MMKeysHookProc, GetModuleHandle(nullptr), 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Unload RCD service (prevent run iTunes on "Play" key)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QProcess launchctl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- launchctl.start("launchctl unload " + g_rcdPath);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (launchctl.waitForFinished() && launchctl.exitStatus() == QProcess::NormalExit)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- g_rcdLoad = !launchctl.readAllStandardError().startsWith(g_rcdPath);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ qsrand(time(nullptr));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ do
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -752,7 +726,7 @@ int main(int argc, char *argv[])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ UnhookWindowsHookEx(keyboardHook);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- exitProcedure();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ unInhibitScreenSaver();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef QT5_NOT_WIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (canDeleteApp)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/gui/MainWidget.cpp src/gui/MainWidget.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 73b52bbb..2e497c39 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/gui/MainWidget.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/gui/MainWidget.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -30,11 +30,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <QFileDialog>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <QTreeWidget>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <QListWidget>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #include <QProcess>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #include <QScreen>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #include <QWindow>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <qevent.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* QMPlay2 gui */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -416,22 +411,11 @@ MainWidget::MainWidget(QPair<QStringList, QStringList> &arguments) :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ playStateChanged(false);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- qApp->installEventFilter(this);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- fileOpenTimer.setSingleShot(true);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- connect(&fileOpenTimer, &QTimer::timeout, this, &MainWidget::fileOpenTimerTimeout);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (QMPlay2GUI.pipe) // Register media keys only for first QMPlay2 instance
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QMPlay2MacExtensions::registerMacOSMediaKeys(std::bind(&MainWidget::processParam, this, std::placeholders::_1, QString()));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (settings.getBool("AutoUpdates"))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ updater.downloadUpdate();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MainWidget::~MainWidget()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QMPlay2MacExtensions::unregisterMacOSMediaKeys();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ QMPlay2Extensions::closeExtensions();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ emit QMPlay2Core.restoreCursor();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Notifies::finalize();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -661,20 +645,11 @@ void MainWidget::resetRotate90()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void MainWidget::visualizationFullScreen()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QWidget *senderW = (QWidget *)sender();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const auto maybeGoFullScreen = [this, senderW] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!fullScreen)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- videoDock->setWidget(senderW);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- toggleFullScreen();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // On macOS if full screen is toggled to fast after double click, mouse remains in clicked state...
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QTimer::singleShot(200, maybeGoFullScreen);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- maybeGoFullScreen();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!fullScreen)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ videoDock->setWidget((QWidget *)sender());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ toggleFullScreen();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void MainWidget::hideAllExtensions()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -871,7 +846,7 @@ void MainWidget::createMenuBar()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ copyMenu(secondMenu, menuBar->help);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (tray)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tray->setContextMenu(secondMenu);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else //On OS X add only the most important menu actions to dock menu
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else // On OS X add only the most important menu actions to dock menu
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ secondMenu->addAction(menuBar->player->togglePlay);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ secondMenu->addAction(menuBar->player->stop);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ secondMenu->addAction(menuBar->player->next);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -879,17 +854,7 @@ void MainWidget::createMenuBar()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ secondMenu->addSeparator();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ secondMenu->addAction(menuBar->player->toggleMute);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ secondMenu->addSeparator();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Copy action, because PreferencesRole doesn't show in dock menu.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QAction *settings = new QAction(menuBar->options->settings->icon(), menuBar->options->settings->text(), menuBar->options->settings->parent());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- connect(settings, &QAction::triggered, menuBar->options->settings, &QAction::trigger);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- secondMenu->addAction(settings);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QAction *newInstanceAct = new QAction(tr("New window"), secondMenu);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- connect(newInstanceAct, &QAction::triggered, [] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QProcess::startDetached(QCoreApplication::applicationFilePath(), {"-noplay"}, QCoreApplication::applicationDirPath());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- });
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- secondMenu->addSeparator();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- secondMenu->addAction(newInstanceAct);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ secondMenu->addAction(menuBar->options->settings);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ qt_mac_set_dock_menu(secondMenu);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -956,13 +921,6 @@ void MainWidget::toggleFullScreen()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static bool visible, compact_view, tb_movable;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifndef Q_OS_ANDROID
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static bool maximized;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (isFullScreen())
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- showNormal();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!fullScreen)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1024,14 +982,7 @@ void MainWidget::toggleFullScreen()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ menuBar->window->toggleFullScreen->setShortcuts(QList<QKeySequence>() << menuBar->window->toggleFullScreen->shortcut() << QKeySequence("ESC"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fullScreen = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifndef Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ showFullScreen();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- setGeometry(window()->windowHandle()->screen()->geometry());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QMPlay2MacExtensions::showSystemUi(windowHandle(), false);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- show();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (playC.isPlaying())
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ QMPlay2GUI.screenSaver->inhibit(1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1048,21 +999,11 @@ void MainWidget::toggleFullScreen()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fullScreen = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifndef Q_OS_ANDROID
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QMPlay2MacExtensions::showSystemUi(windowHandle(), true);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- setWindowFlags(Qt::Window);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ showNormal();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif // Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (maximized)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ showMaximized();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- showNormal();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ setGeometry(savedGeo);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else // Q_OS_ANDROID
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ showMaximized();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1610,24 +1551,3 @@ void MainWidget::hideEvent(QHideEvent *)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ menuBar->window->toggleVisibility->setText(tr("&Show"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-bool MainWidget::eventFilter(QObject *obj, QEvent *event)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (event->type() == QEvent::FileOpen)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- filesToAdd.append(((QFileOpenEvent *)event)->file());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- fileOpenTimer.start(10);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return QMainWindow::eventFilter(obj, event);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-void MainWidget::fileOpenTimerTimeout()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (filesToAdd.count() == 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- playlistDock->addAndPlay(filesToAdd.at(0));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- playlistDock->addAndPlay(filesToAdd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- filesToAdd.clear();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/gui/MainWidget.hpp src/gui/MainWidget.hpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index c8fd2396..8acb23dc 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/gui/MainWidget.hpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/gui/MainWidget.hpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -134,15 +134,6 @@ private:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void showEvent(QShowEvent *) override final;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void hideEvent(QHideEvent *) override final;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- bool eventFilter(QObject *obj, QEvent *event) override final;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- void fileOpenTimerTimeout();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QTimer fileOpenTimer;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QStringList filesToAdd;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MenuBar *menuBar;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ QToolBar *mainTB;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ QStatusBar *statusBar;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/gui/MenuBar.cpp src/gui/MenuBar.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index f1e1f12a..e8364819 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/gui/MenuBar.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/gui/MenuBar.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -29,9 +29,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <QInputDialog>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <QMainWindow>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <QDir>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #include <QTimer>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static QAction *newAction(const QString &txt, QMenu *parent, QAction *&act, bool autoRepeat, const QIcon &icon, bool checkable, QAction::MenuRole role = QAction::NoRole)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -362,27 +359,6 @@ MenuBar::Playback::VideoFilters::VideoFilters(QMenu *parent) :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ widgetAction->setDefaultWidget(QMPlay2GUI.videoAdjustment);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ QMPlay2GUI.videoAdjustment->setObjectName(videoAdjustmentMenu->title().remove('&'));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ videoAdjustmentMenu->addAction(widgetAction);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Update visibility and update geometry of video adjustment widget
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- connect(videoAdjustmentMenu, &VideoFilters::aboutToShow, [] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QWidget *parent = QMPlay2GUI.videoAdjustment->parentWidget();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (parent)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const QString parentObject = parent->metaObject()->className();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (parentObject == "QMacNativeWidget")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QMPlay2GUI.videoAdjustment->update();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QMPlay2GUI.videoAdjustment->show();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (parentObject == "QMacNativeWidget" || parentObject == "QMenu")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QTimer::singleShot(1, [parent] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QMPlay2GUI.videoAdjustment->setGeometry(parent->rect());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- });
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- });
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /**/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ addSeparator();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ newAction(VideoFilters::tr("&Spherical view"), this, spherical, true, QIcon(), true);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/gui/VideoDock.cpp src/gui/VideoDock.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 7f23d58e..a726b275 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/gui/VideoDock.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/gui/VideoDock.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -334,16 +334,7 @@ bool VideoDock::event(QEvent *e)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void VideoDock::popup(const QPoint &p)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (canPopup)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef Q_OS_MAC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Move parent of video adjustment widget from native Mac widget to QMenu
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QWidget *videoAdj = (QWidget *)QMPlay2GUI.videoAdjustment;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QWidget *parent = videoAdj->parentWidget();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (parent && qstrcmp(parent->metaObject()->className(), "QMacNativeWidget") == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- videoAdj->setParent(QMPlay2GUI.menuBar->playback->videoFilters->videoAdjustmentMenu);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ popupMenu->popup(mapToGlobal(p));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void VideoDock::hideCursor()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/gui/macOS/QMPlay2MacExtensions.hpp src/gui/macOS/QMPlay2MacExtensions.hpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 74b9a6d5..38740e6c 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/gui/macOS/QMPlay2MacExtensions.hpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/gui/macOS/QMPlay2MacExtensions.hpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -18,19 +18,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #pragma once
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <functional>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-class QString;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-class QWindow;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ namespace QMPlay2MacExtensions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- using MediaKeysCallback = std::function<void(const QString ¶m)>;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void setApplicationVisible(bool visible);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- void registerMacOSMediaKeys(const MediaKeysCallback &fn);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- void unregisterMacOSMediaKeys();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- void showSystemUi(QWindow *mainWindow, bool visible);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/gui/macOS/QMPlay2MacExtensions.mm src/gui/macOS/QMPlay2MacExtensions.mm
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 5c729222..7260c44c 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/gui/macOS/QMPlay2MacExtensions.mm
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/gui/macOS/QMPlay2MacExtensions.mm
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,66 +1,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "QMPlay2MacExtensions.hpp"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <QAbstractNativeEventFilter>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <QGuiApplication>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <QWindow>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <IOKit/hidsystem/ev_keymap.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <AppKit/NSApplication.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <AppKit/NSScreen.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#include <AppKit/NSEvent.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-class MediaKeysFilter : public QAbstractNativeEventFilter
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-public:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- MediaKeysFilter(const QMPlay2MacExtensions::MediaKeysCallback &cb) :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- m_mediaKeysCallback(cb)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-private:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override final
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Q_UNUSED(result)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (eventType == "mac_generic_NSEvent")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- NSEvent *event = static_cast<NSEvent *>(message);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if defined(MAC_OS_X_VERSION_10_12) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ([event type] == NSEventTypeSystemDefined)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ([event type] == NSSystemDefined)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int keyCode = ([event data1] & 0xFFFF0000) >> 16;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int keyFlags = ([event data1] & 0x0000FFFF);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int keyState = (((keyFlags & 0xFF00) >> 8) == 0xA);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const bool keyRepeat = (keyFlags & 0x1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Q_UNUSED(keyRepeat)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (keyState == 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- switch (keyCode)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case NX_KEYTYPE_PLAY:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- m_mediaKeysCallback("toggle");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case NX_KEYTYPE_NEXT:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case NX_KEYTYPE_FAST:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- m_mediaKeysCallback("next");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case NX_KEYTYPE_PREVIOUS:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case NX_KEYTYPE_REWIND:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- m_mediaKeysCallback("prev");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QMPlay2MacExtensions::MediaKeysCallback m_mediaKeysCallback;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-} static *g_mediaKeysFilter;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/**/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <AppKit/AppKit.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void QMPlay2MacExtensions::setApplicationVisible(bool visible)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -70,35 +10,3 @@ void QMPlay2MacExtensions::setApplicationVisible(bool visible)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ [app hide:nil];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-void QMPlay2MacExtensions::registerMacOSMediaKeys(const MediaKeysCallback &cb)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!g_mediaKeysFilter)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- g_mediaKeysFilter = new MediaKeysFilter(cb);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QCoreApplication::instance()->installNativeEventFilter(g_mediaKeysFilter);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-void QMPlay2MacExtensions::unregisterMacOSMediaKeys()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (g_mediaKeysFilter)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QCoreApplication::instance()->removeNativeEventFilter(g_mediaKeysFilter);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- delete g_mediaKeysFilter;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- g_mediaKeysFilter = nullptr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-void QMPlay2MacExtensions::showSystemUi(QWindow *mainWindow, bool visible)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if defined(MAC_OS_X_VERSION_10_9) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (mainWindow && mainWindow->screen() != QGuiApplication::primaryScreen() && ![NSScreen screensHaveSeparateSpaces])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- unsigned long flags;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (visible)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- flags = NSApplicationPresentationDefault;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- flags = NSApplicationPresentationHideDock | NSApplicationPresentationAutoHideMenuBar;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- [NSApp setPresentationOptions:flags];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/qmplay2/IPC_Unix.cpp src/qmplay2/IPC_Unix.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 974e8d26..890804fa 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/qmplay2/IPC_Unix.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/qmplay2/IPC_Unix.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -98,8 +98,7 @@ bool IPCSocket::open(QIODevice::OpenMode mode)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (m_priv->fd > 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const u_long on = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ioctl(m_priv->fd, FIONBIO, &on);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ioctl(m_priv->fd, FIONBIO, "\xFF\xFF\xFF\xFF");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m_priv->socketNotifier = new QSocketNotifier(m_priv->fd, QSocketNotifier::Read, this);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ connect(m_priv->socketNotifier, SIGNAL(activated(int)), this, SLOT(socketReadActive()));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return QIODevice::open(mode);
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/multimedia/QMPlay2/files/0006-FFMpeg-fix-compatibility-with-modern-FFMpeg.patch b/multimedia/QMPlay2/files/0006-FFMpeg-fix-compatibility-with-modern-FFMpeg.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..1e850b3d92a
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/multimedia/QMPlay2/files/0006-FFMpeg-fix-compatibility-with-modern-FFMpeg.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,994 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From f32edcb5492ce1920361f0ac62516efe11e0c989 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: barracuda156 <vital.had@gmail.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Sat, 23 Dec 2023 20:57:17 +0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH] FFMpeg: fix compatibility with modern FFMpeg
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Backport of:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/zaps166/QMPlay2/commit/6da1224fe664ecc2c8d8c8e0b57a81605938c35a
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/zaps166/QMPlay2/commit/66a8c123c54bd83bcdc2a6ab9b073acd0a97368e
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/zaps166/QMPlay2/commit/f9dbff5e3e3eab7f877d28a25dcbbc4839c88213
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git README.md README.md
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 31571b5e..6a3e82e7 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- README.md
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ README.md
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -157,7 +157,7 @@ For CMake build be sure that you have correct CMake version:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ - QtOpenGL - not used since Qt 5.6.0,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ - QtDBus - Linux/BSD only,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ - QtSvg - for SVG icons,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-- FFmpeg >= 2.2 (>= 2.5.x recommended; >= 3.1.x recommended for CUVID):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++- FFmpeg >= 3.1:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ - libavformat - requires OpenSSL or GnuTLS for https support,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ - libavcodec - for FFmpeg module only,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ - libswscale,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/modules/CUVID/CuvidDec.cpp src/modules/CUVID/CuvidDec.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 637878c1..de44793e 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/modules/CUVID/CuvidDec.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/modules/CUVID/CuvidDec.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -44,28 +44,6 @@ extern "C"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <libswscale/swscale.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #define NEW_BSF_API
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #warning "FFmpeg 3.1 or higher is required for H264 and HEVC non Annex B support in CUVID"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- static bool checkAnnexB(const QByteArray &extraData, AVCodecID codecID)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const quint8 *data = (const quint8 *)extraData.constData();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int size = extraData.size();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- switch (codecID)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case AV_CODEC_ID_H264:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return size == 0 || (size >= 3 && (!data[0] && !data[1] && (data[2] == 1 || (size >= 4 && data[3] == 1))));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case AV_CODEC_ID_HEVC:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return size < 23 || (!data[0] && !data[1] && (data[2] == 1 || data[3] == 1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ namespace cu
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ using cuInitType = CUresult CUDAAPI (*)(unsigned int flags);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -520,14 +498,10 @@ CuvidDec::~CuvidDec()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!m_writer)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cu::ctxDestroy(m_cuCtx);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef NEW_BSF_API
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ av_bsf_free(&m_bsfCtx);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (m_swsCtx)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sws_freeContext(m_swsCtx);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef NEW_BSF_API
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ av_packet_free(&m_pkt);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ av_buffer_unref(&m_nv12Chroma);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (int p = 0; p < 3; ++p)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ av_buffer_unref(&m_frameBuffer[p]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -675,7 +649,6 @@ int CuvidDec::decodeVideo(Packet &encodedPacket, VideoFrame &decoded, QByteArray
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cuvidPkt.flags = CUVID_PKT_TIMESTAMP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cuvidPkt.timestamp = encodedPacket.ts.pts() * 10000000.0 + 0.5;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef NEW_BSF_API
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (m_bsfCtx)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m_pkt->buf = encodedPacket.toAvBufferRef();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -698,7 +671,6 @@ int CuvidDec::decodeVideo(Packet &encodedPacket, VideoFrame &decoded, QByteArray
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cuvidPkt.payload_size = m_pkt->size;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cuvidPkt.payload = encodedPacket.constData();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cuvidPkt.payload_size = encodedPacket.size();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -710,10 +682,8 @@ int CuvidDec::decodeVideo(Packet &encodedPacket, VideoFrame &decoded, QByteArray
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (cuvidPkt.flags == CUVID_PKT_TIMESTAMP && videoDataParsed)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m_timestamps.enqueue(encodedPacket.ts);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef NEW_BSF_API
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (m_pkt)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ av_packet_unref(m_pkt);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (m_cuvidSurfaces.isEmpty())
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ encodedPacket.ts.setInvalid();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -853,11 +823,7 @@ bool CuvidDec::open(StreamInfo &streamInfo, VideoWriter *writer)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int depth = 8;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (const AVPixFmtDescriptor *pixDesc = av_pix_fmt_desc_get(pixFmt))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 24, 102)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depth = pixDesc->comp[0].depth;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- depth = pixDesc->comp[0].depth_minus1 + 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cudaVideoCodec codec;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -906,7 +872,6 @@ bool CuvidDec::open(StreamInfo &streamInfo, VideoWriter *writer)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const AVBitStreamFilter *bsf = nullptr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ switch (codec)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef NEW_BSF_API
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case cudaVideoCodec_H264:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bsf = av_bsf_get_by_name("h264_mp4toannexb");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!bsf)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -917,14 +882,6 @@ bool CuvidDec::open(StreamInfo &streamInfo, VideoWriter *writer)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!bsf)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case cudaVideoCodec_H264:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case cudaVideoCodec_HEVC:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (checkAnnexB(streamInfo.data, avCodec->id))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QMPlay2Core.logError("CUVID :: " + tr("Compilation with FFmpeg 3.1 or higher is required for H264 and HEVC support!"), true, true);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -933,7 +890,6 @@ bool CuvidDec::open(StreamInfo &streamInfo, VideoWriter *writer)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!bsf)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extraData = streamInfo.data;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef NEW_BSF_API
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ av_bsf_alloc(bsf, &m_bsfCtx);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -951,7 +907,6 @@ bool CuvidDec::open(StreamInfo &streamInfo, VideoWriter *writer)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m_pkt = av_packet_alloc();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m_width = streamInfo.W;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m_height = streamInfo.H;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/modules/FFmpeg/FFCommon.cpp src/modules/FFmpeg/FFCommon.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index f2521500..c2df0e5f 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/modules/FFmpeg/FFCommon.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/modules/FFmpeg/FFCommon.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -31,32 +31,9 @@ extern "C"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-AVPacket *FFCommon::createAVPacket()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AVPacket *packet;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVCODEC_VERSION_MAJOR >= 57
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- packet = av_packet_alloc();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- packet = (AVPacket *)av_malloc(sizeof(AVPacket));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- av_init_packet(packet);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return packet;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-void FFCommon::freeAVPacket(AVPacket *&packet)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVCODEC_VERSION_MAJOR >= 57
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- av_packet_free(&packet);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (packet)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- av_packet_unref(packet);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- av_freep(&packet);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef QMPlay2_VDPAU
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AVVDPAUContext *FFCommon::allocAVVDPAUContext(AVCodecContext *codecCtx)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 13, 100) // FFmpeg 2.5.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // Since FFmpeg 3.3 we must not use "av_vdpau_alloc_context()" or "AVVDPAUContext" structure size
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // for allocating "AVCodecContext::hwaccel_context", because internally it always uses field from
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // different internal structure which is larger. Using different struct inside FFmpeg was provided
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -67,8 +44,5 @@ AVVDPAUContext *FFCommon::allocAVVDPAUContext(AVCodecContext *codecCtx)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (av_vdpau_bind_context(codecCtx, 0, nullptr, 0) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (AVVDPAUContext *)codecCtx->hwaccel_context;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return nullptr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return av_vdpau_alloc_context();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/modules/FFmpeg/FFCommon.hpp src/modules/FFmpeg/FFCommon.hpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 9aebf57c..3e82c686 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/modules/FFmpeg/FFCommon.hpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/modules/FFmpeg/FFCommon.hpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -41,9 +41,6 @@ class VideoFrame;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ namespace FFCommon
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AVPacket *createAVPacket();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- void freeAVPacket(AVPacket *&packet);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef QMPlay2_VDPAU
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AVVDPAUContext *allocAVVDPAUContext(AVCodecContext *codecCtx);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/modules/FFmpeg/FFDec.cpp src/modules/FFmpeg/FFDec.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index fd46bb37..13df6be1 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/modules/FFmpeg/FFDec.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/modules/FFmpeg/FFDec.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -39,7 +39,7 @@ FFDec::FFDec(QMutex &avcodec_mutex) :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ FFDec::~FFDec()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ av_frame_free(&frame);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- FFCommon::freeAVPacket(packet);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ av_packet_free(&packet);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (codecIsOpen)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ avcodec_mutex.lock();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -84,7 +84,7 @@ bool FFDec::openCodec(AVCodec *codec)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ avcodec_mutex.unlock();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- packet = FFCommon::createAVPacket();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ packet = av_packet_alloc();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ switch (codec_ctx->codec_type)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case AVMEDIA_TYPE_VIDEO:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/modules/FFmpeg/FFDecSW.cpp src/modules/FFmpeg/FFDecSW.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 97930c46..dfae9f78 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/modules/FFmpeg/FFDecSW.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/modules/FFmpeg/FFDecSW.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -31,6 +31,10 @@ extern "C"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <libavutil/pixdesc.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifndef AV_CODEC_FLAG2_FAST
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #define AV_CODEC_FLAG2_FAST CODEC_FLAG2_FAST
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ FFDecSW::FFDecSW(QMutex &avcodec_mutex, Module &module) :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ FFDec(avcodec_mutex),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ threads(0), lowres(0),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -213,14 +217,14 @@ int FFDecSW::decodeVideo(Packet &encodedPacket, VideoFrame &decoded, QByteArray
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ codec_ctx->skip_loop_filter = AVDISCARD_ALL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (hurry_up > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ codec_ctx->skip_idct = AVDISCARD_NONREF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codec_ctx->flags2 |= CODEC_FLAG2_FAST;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ codec_ctx->flags2 |= AV_CODEC_FLAG2_FAST;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!forceSkipFrames)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ codec_ctx->skip_frame = AVDISCARD_DEFAULT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ codec_ctx->skip_loop_filter = codec_ctx->skip_idct = AVDISCARD_DEFAULT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codec_ctx->flags2 &= ~CODEC_FLAG2_FAST;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ codec_ctx->flags2 &= ~AV_CODEC_FLAG2_FAST;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bytes_consumed = avcodec_decode_video2(codec_ctx, frame, &frameFinished, packet);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -304,15 +308,9 @@ bool FFDecSW::decodeSubtitle(const Packet &encodedPacket, double pos, QMPlay2OSD
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ buff->y = av_clip(rect->y, 0, h - buff->h);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ buff->bitmap.resize((buff->w * buff->h) << 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVCODEC_VERSION_MAJOR >= 57
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const uint8_t *source = (uint8_t *)rect->data[0];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const uint32_t *palette = (uint32_t *)rect->data[1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int linesize = rect->linesize[0];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const uint8_t *source = (uint8_t *)rect->pict.data[0];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const uint32_t *palette = (uint32_t *)rect->pict.data[1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int linesize = rect->pict.linesize[0];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ uint32_t *dest = (uint32_t *)buff->bitmap.data();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (int y = 0; y < buff->h; ++y)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -339,8 +337,6 @@ bool FFDecSW::open(StreamInfo &streamInfo, VideoWriter *)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (codec_ctx->codec_type == AVMEDIA_TYPE_VIDEO)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (codec->capabilities & CODEC_CAP_DR1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codec_ctx->flags |= CODEC_FLAG_EMU_EDGE; //Does nothing since FFmpeg 2.3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((codec_ctx->thread_count = threads) != 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!thread_type_slice)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/modules/FFmpeg/FFDecVDPAU.cpp src/modules/FFmpeg/FFDecVDPAU.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 8624a3e7..44050402 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/modules/FFmpeg/FFDecVDPAU.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/modules/FFmpeg/FFDecVDPAU.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -75,7 +75,7 @@ bool FFDecVDPAU::open(StreamInfo &streamInfo, VideoWriter *writer)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ new HWAccelHelper(codec_ctx, AV_PIX_FMT_VDPAU, vdpauCtx, vdpauWriter->getSurfacesQueue());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (pix_fmt == AV_PIX_FMT_YUVJ420P && avcodec_version() >= 0x383C64)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (pix_fmt == AV_PIX_FMT_YUVJ420P)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ codec_ctx->pix_fmt = AV_PIX_FMT_YUV420P; //Force full color range
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (openCodec(codec))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/modules/FFmpeg/FFReader.cpp src/modules/FFmpeg/FFReader.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 6bdb00d0..4e3b7d54 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/modules/FFmpeg/FFReader.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/modules/FFmpeg/FFReader.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -105,11 +105,7 @@ void FFReader::pause()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bool FFReader::atEnd() const
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVFORMAT_VERSION_MAJOR >= 56
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return avio_feof(avioCtx);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return url_feof(avioCtx);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void FFReader::abort()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/modules/FFmpeg/FFmpeg.cpp src/modules/FFmpeg/FFmpeg.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index ca5fb817..b6285a61 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/modules/FFmpeg/FFmpeg.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/modules/FFmpeg/FFmpeg.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -258,9 +258,7 @@ ModuleSettingsWidget::ModuleSettingsWidget(Module &module) :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reconnectStreamedB = new QCheckBox(tr("Try to automatically reconnect live streams on error"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reconnectStreamedB->setChecked(sets().getBool("ReconnectStreamed"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(57, 25, 100)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- reconnectStreamedB->setEnabled(false);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ reconnectStreamedB->setEnabled(false);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ decoderB = new QGroupBox(tr("Software decoder"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ decoderB->setCheckable(true);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/modules/FFmpeg/FormatContext.cpp src/modules/FFmpeg/FormatContext.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index e989db44..da13fa3d 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/modules/FFmpeg/FormatContext.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/modules/FFmpeg/FormatContext.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -25,23 +25,13 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <Settings.hpp>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <Packet.hpp>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVFORMAT_VERSION_INT >= 0x373000 // >= 55.48.00
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #define HAS_REPLAY_GAIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern "C"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <libavformat/avformat.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef HAS_REPLAY_GAIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <libavutil/replaygain.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <libavutil/pixdesc.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVFORMAT_VERSION_MAJOR <= 55
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #include <libavutil/opt.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVFORMAT_VERSION_MAJOR > 55
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void matroska_fix_ass_packet(AVRational stream_timebase, AVPacket *pkt)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AVBufferRef *line;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -70,7 +60,7 @@ static void matroska_fix_ass_packet(AVRational stream_timebase, AVPacket *pkt)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ es = ec / 100;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ec -= 100 * es;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *ptr++ = '\0';
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- len = 50 + end - ptr + FF_INPUT_BUFFER_PADDING_SIZE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ len = 50 + end - ptr + AV_INPUT_BUFFER_PADDING_SIZE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!(line = av_buffer_alloc(len)))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ snprintf((char *)line->data, len, "Dialogue: %s,%d:%02d:%02d.%02d,%d:%02d:%02d.%02d,%s\r\n", layer, sh, sm, ss, sc, eh, em, es, ec, ptr);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -80,35 +70,6 @@ static void matroska_fix_ass_packet(AVRational stream_timebase, AVPacket *pkt)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pkt->size = strlen((char *)line->data);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVFORMAT_VERSION_INT >= 0x392900
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- static inline AVCodecParameters *codecParams(AVStream *stream)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return stream->codecpar;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- static inline const char *getPixelFormat(AVStream *stream)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return av_get_pix_fmt_name((AVPixelFormat)stream->codecpar->format);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- static inline const char *getSampleFormat(AVStream *stream)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return av_get_sample_fmt_name((AVSampleFormat)stream->codecpar->format);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- static inline AVCodecContext *codecParams(AVStream *stream)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return stream->codec;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- static inline const char *getPixelFormat(AVStream *stream)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return av_get_pix_fmt_name(stream->codec->pix_fmt);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- static inline const char *getSampleFormat(AVStream *stream)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return av_get_sample_fmt_name(stream->codec->sample_fmt);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static QByteArray getTag(AVDictionary *metadata, const char *key, const bool deduplicate = true)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -159,14 +120,14 @@ static QByteArray getTag(AVDictionary *metadata, const char *key, const bool ded
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void fixFontsAttachment(AVStream *stream)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (codecParams(stream)->codec_type == AVMEDIA_TYPE_ATTACHMENT && codecParams(stream)->codec_id == AV_CODEC_ID_NONE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (stream->codecpar->codec_type == AVMEDIA_TYPE_ATTACHMENT && stream->codecpar->codec_id == AV_CODEC_ID_NONE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // If codec for fonts is unknown - check the attachment file name extension
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const QString attachmentFileName = getTag(stream->metadata, "filename", false);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (attachmentFileName.endsWith(".otf", Qt::CaseInsensitive))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->codec_id = AV_CODEC_ID_OTF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ stream->codecpar->codec_id = AV_CODEC_ID_OTF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else if (attachmentFileName.endsWith(".ttf", Qt::CaseInsensitive))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->codec_id = AV_CODEC_ID_TTF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ stream->codecpar->codec_id = AV_CODEC_ID_TTF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -175,8 +136,8 @@ static bool streamNotValid(AVStream *stream)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (stream->disposition & AV_DISPOSITION_ATTACHED_PIC) ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (codecParams(stream)->codec_type == AVMEDIA_TYPE_DATA) ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (codecParams(stream)->codec_type == AVMEDIA_TYPE_ATTACHMENT && codecParams(stream)->codec_id != AV_CODEC_ID_TTF && codecParams(stream)->codec_id != AV_CODEC_ID_OTF)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (stream->codecpar->codec_type == AVMEDIA_TYPE_DATA) ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (stream->codecpar->codec_type == AVMEDIA_TYPE_ATTACHMENT && stream->codecpar->codec_id != AV_CODEC_ID_TTF && stream->codecpar->codec_id != AV_CODEC_ID_OTF)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -254,28 +215,26 @@ FormatContext::~FormatContext()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (AVStream *stream : streams)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (codecParams(stream) && !streamNotValid(stream))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (stream->codecpar && !streamNotValid(stream))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- //Data is allocated in QByteArray, so FFmpeg mustn't free it!
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->extradata = nullptr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->extradata_size = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Data is allocated in QByteArray, so FFmpeg mustn't free it!
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ stream->codecpar->extradata = nullptr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ stream->codecpar->extradata_size = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ avformat_close_input(&formatCtx);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- FFCommon::freeAVPacket(packet);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ av_packet_free(&packet);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ delete oggHelper;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bool FormatContext::metadataChanged() const
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVFORMAT_VERSION_MAJOR > 55
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (formatCtx->event_flags & AVFMT_EVENT_FLAG_METADATA_UPDATED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ formatCtx->event_flags = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ isMetadataChanged = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (isMetadataChanged)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ isMetadataChanged = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -306,7 +265,7 @@ QList<ProgramInfo> FormatContext::getPrograms() const
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int idx = index_map[ff_idx];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (idx > -1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const QMPlay2MediaType type = (QMPlay2MediaType)codecParams(streams[ff_idx])->codec_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const QMPlay2MediaType type = (QMPlay2MediaType)streams[ff_idx]->codecpar->codec_type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (type != QMPLAY2_TYPE_UNKNOWN)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ programInfo.streams += {idx, type};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -399,7 +358,6 @@ QList<QMPlay2Tag> FormatContext::tags() const
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bool FormatContext::getReplayGain(bool album, float &gain_db, float &peak) const
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef HAS_REPLAY_GAIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int streamIdx = av_find_best_stream(formatCtx, AVMEDIA_TYPE_AUDIO, -1, -1, nullptr, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (streamIdx > -1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -434,7 +392,6 @@ bool FormatContext::getReplayGain(bool album, float &gain_db, float &peak) const
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (AVDictionary *dict = getMetadata())
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ QString album_gain_db = getTag(dict, "REPLAYGAIN_ALBUM_GAIN", false);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -514,37 +471,28 @@ bool FormatContext::seek(double pos, bool backward)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pos = 0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else if (len > 0.0 && pos > len)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pos = len;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifndef MP3_FAST_SEEK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (seekByByteOffset < 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const double posToSeek = pos + startTime;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const qint64 timestamp = ((streamsInfo.count() == 1) ? posToSeek : (backward ? floor(posToSeek) : ceil(posToSeek))) * AV_TIME_BASE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const double posToSeek = pos + startTime;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const qint64 timestamp = ((streamsInfo.count() == 1) ? posToSeek : (backward ? floor(posToSeek) : ceil(posToSeek))) * AV_TIME_BASE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- isOk = av_seek_frame(formatCtx, -1, timestamp, backward ? AVSEEK_FLAG_BACKWARD : 0) >= 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!isOk)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ isOk = av_seek_frame(formatCtx, -1, timestamp, backward ? AVSEEK_FLAG_BACKWARD : 0) >= 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!isOk)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const int ret = av_read_frame(formatCtx, packet);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ret == AVERROR_EOF || ret == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- const int ret = av_read_frame(formatCtx, packet);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (ret == AVERROR_EOF || ret == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (len <= 0.0 || pos < len)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- isOk = av_seek_frame(formatCtx, -1, timestamp, !backward ? AVSEEK_FLAG_BACKWARD : 0) >= 0; //Negate "backward" and try again
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if (ret == AVERROR_EOF)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- isOk = true; //Allow seek to the end of the file, clear buffers and finish the playback
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (isOk)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- av_packet_unref(packet);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!isOk) //If seek failed - allow to use the packet
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- errFromSeek = ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- maybeHasFrame = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (len <= 0.0 || pos < len)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ isOk = av_seek_frame(formatCtx, -1, timestamp, !backward ? AVSEEK_FLAG_BACKWARD : 0) >= 0; //Negate "backward" and try again
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if (ret == AVERROR_EOF)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ isOk = true; // Allow seek to the end of the file, clear buffers and finish the playback
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (isOk)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ av_packet_unref(packet);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!isOk) // If seek failed - allow to use the packet
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ errFromSeek = ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ maybeHasFrame = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifndef MP3_FAST_SEEK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if (length() > 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- isOk = av_seek_frame(formatCtx, -1, (qint64)pos * (avio_size(formatCtx->pb) - seekByByteOffset) / length() + seekByByteOffset, AVSEEK_FLAG_BYTE | (backward ? AVSEEK_FLAG_BACKWARD : 0)) >= 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (isOk)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (int i = 0; i < streamsTS.count(); ++i)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -609,49 +557,16 @@ bool FormatContext::read(Packet &encoded, int &idx)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVFORMAT_VERSION_MAJOR > 55
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (streams.at(ff_idx)->event_flags & AVSTREAM_EVENT_FLAG_METADATA_UPDATED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ streams.at(ff_idx)->event_flags = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ isMetadataChanged = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (fixMkvAss && codecParams(streams.at(ff_idx))->codec_id == AV_CODEC_ID_ASS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (fixMkvAss && streams.at(ff_idx)->codecpar->codec_id == AV_CODEC_ID_ASS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ matroska_fix_ass_packet(streams.at(ff_idx)->time_base, packet);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (isStreamed)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- char *value = nullptr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- av_opt_get(formatCtx, "icy_metadata_packet", AV_OPT_SEARCH_CHILDREN, (quint8 **)&value);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QString icyPacket = value;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- av_free(value);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int idx = icyPacket.indexOf("StreamTitle='");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (idx > -1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int idx2 = icyPacket.indexOf("';", idx += 13);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (idx2 > -1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AVDictionaryEntry *e = av_dict_get(formatCtx->metadata, "StreamTitle", nullptr, AV_DICT_IGNORE_SUFFIX);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- icyPacket = icyPacket.mid(idx, idx2-idx);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!e || QString(e->value) != icyPacket)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- av_dict_set(&formatCtx->metadata, "StreamTitle", icyPacket.toUtf8(), 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- isMetadataChanged = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if (AVDictionary *dict = getMetadata())
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (metadata != dict)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- metadata = dict;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- isMetadataChanged = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!packet->buf || forceCopy) //Buffer isn't reference-counted, so copy the data
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- encoded.assign(packet->data, packet->size, packet->size + FF_INPUT_BUFFER_PADDING_SIZE);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!packet->buf || forceCopy) // Buffer isn't reference-counted, so copy the data
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ encoded.assign(packet->data, packet->size, packet->size + AV_INPUT_BUFFER_PADDING_SIZE);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ encoded.assign(packet->buf, packet->size);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -660,22 +575,11 @@ bool FormatContext::read(Packet &encoded, int &idx)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const double time_base = av_q2d(streams.at(ff_idx)->time_base);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifndef MP3_FAST_SEEK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (seekByByteOffset < 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- encoded.ts.setInvalid();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (packet->dts != QMPLAY2_NOPTS_VALUE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- encoded.ts.setDts(packet->dts * time_base, startTime);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (packet->pts != QMPLAY2_NOPTS_VALUE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- encoded.ts.setPts(packet->pts * time_base, startTime);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifndef MP3_FAST_SEEK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if (packet->pos > -1 && length() > 0.0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- lastTime = encoded.ts = ((packet->pos - seekByByteOffset) * length()) / (avio_size(formatCtx->pb) - seekByByteOffset);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- encoded.ts = lastTime;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ encoded.ts.setInvalid();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (packet->dts != QMPLAY2_NOPTS_VALUE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ encoded.ts.setDts(packet->dts * time_base, startTime);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (packet->pts != QMPLAY2_NOPTS_VALUE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ encoded.ts.setPts(packet->pts * time_base, startTime);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (packet->duration > 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ encoded.duration = packet->duration * time_base;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -765,10 +669,8 @@ bool FormatContext::open(const QString &_url, const QString ¶m)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!inputFmt)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ url = Functions::prepareFFmpegUrl(_url, options);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 25, 100)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!isLocal && reconnectStreamed)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ av_dict_set(&options, "reconnect_streamed", "1", 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ formatCtx = avformat_alloc_context();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -800,12 +702,8 @@ bool FormatContext::open(const QString &_url, const QString ¶m)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ stillImage = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef MP3_FAST_SEEK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (name() == "mp3")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- formatCtx->flags |= AVFMT_FLAG_FAST_SEEK; //This should be set before "avformat_open_input", but seems to be working for MP3...
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- seekByByteOffset = formatCtx->pb ? avio_tell(formatCtx->pb) : -1; //formatCtx->data_offset, moved to private since FFmpeg 2.6
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ formatCtx->flags |= AVFMT_FLAG_FAST_SEEK; // This should be set before "avformat_open_input", but seems to be working for MP3...
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ avcodec_mutex.lock();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (avformat_find_stream_info(formatCtx, nullptr) < 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -815,14 +713,10 @@ bool FormatContext::open(const QString &_url, const QString ¶m)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ avcodec_mutex.unlock();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- isStreamed = !isLocal && formatCtx->duration <= 0; //QMPLAY2_NOPTS_VALUE is negative
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifndef MP3_FAST_SEEK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (seekByByteOffset > -1 && (isStreamed || name() != "mp3"))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- seekByByteOffset = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ isStreamed = !isLocal && formatCtx->duration <= 0; // QMPLAY2_NOPTS_VALUE is negative
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef QMPlay2_libavdevice
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- forceCopy = name().contains("v4l2"); //Workaround for v4l2 - if many buffers are referenced demuxer doesn't produce proper timestamps (FFmpeg BUG?).
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ forceCopy = name().contains("v4l2"); // Workaround for v4l2 - if many buffers are referenced demuxer doesn't produce proper timestamps (FFmpeg BUG?).
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ forceCopy = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -845,11 +739,9 @@ bool FormatContext::open(const QString &_url, const QString ¶m)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ index_map[i] = streamsInfo.count();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ streamsInfo += streamInfo;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVFORMAT_VERSION_MAJOR > 55
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!fixMkvAss && codecParams(formatCtx->streams[i])->codec_id == AV_CODEC_ID_ASS && !strncasecmp(formatCtx->iformat->name, "matroska", 8))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!fixMkvAss && formatCtx->streams[i]->codecpar->codec_id == AV_CODEC_ID_ASS && !strncasecmp(formatCtx->iformat->name, "matroska", 8))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fixMkvAss = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ formatCtx->streams[i]->event_flags = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ streams += formatCtx->streams[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ streamsTS[i] = 0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -857,34 +749,14 @@ bool FormatContext::open(const QString &_url, const QString ¶m)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (streamsInfo.isEmpty())
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- isOneStreamOgg = (name() == "ogg" && streamsInfo.count() == 1); //Workaround for OGG network streams
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ isOneStreamOgg = (name() == "ogg" && streamsInfo.count() == 1); // Workaround for OGG network streams
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (isStreamed && streamsInfo.count() == 1 && streamsInfo.at(0)->type == QMPLAY2_TYPE_SUBTITLE && formatCtx->pb && avio_size(formatCtx->pb) > 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- isStreamed = false; //Allow subtitles streams to be non-streamed if size is known
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ isStreamed = false; // Allow subtitles streams to be non-streamed if size is known
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVFORMAT_VERSION_MAJOR > 55
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ formatCtx->event_flags = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!isStreamed)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- metadata = nullptr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- char *value = nullptr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- av_opt_get(formatCtx, "icy_metadata_headers", AV_OPT_SEARCH_CHILDREN, (quint8 **)&value);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- QStringList icyHeaders = QString(value).split("\n", QString::SkipEmptyParts);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- av_free(value);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (const QString &icy : icyHeaders)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (icy.startsWith("icy-name: "))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- av_dict_set(&formatCtx->metadata, "icy-name", icy.mid(10).toUtf8(), 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if (icy.startsWith("icy-description: "))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- av_dict_set(&formatCtx->metadata, "icy-description", icy.mid(17).toUtf8(), 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- metadata = getMetadata();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- packet = FFCommon::createAVPacket();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ packet = av_packet_alloc();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -910,11 +782,11 @@ StreamInfo *FormatContext::getStreamInfo(AVStream *stream) const
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ StreamInfo *streamInfo = new StreamInfo;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (const AVCodec *codec = avcodec_find_decoder(codecParams(stream)->codec_id))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (const AVCodec *codec = avcodec_find_decoder(stream->codecpar->codec_id))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ streamInfo->codec_name = codec->name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ streamInfo->must_decode = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (const AVCodecDescriptor *codecDescr = avcodec_descriptor_get(codecParams(stream)->codec_id))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (const AVCodecDescriptor *codecDescr = avcodec_descriptor_get(stream->codecpar->codec_id))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (codecDescr->props & AV_CODEC_PROP_TEXT_SUB)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ streamInfo->must_decode = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -923,21 +795,21 @@ StreamInfo *FormatContext::getStreamInfo(AVStream *stream) const
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ streamInfo->codec_name = codecDescr->name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- streamInfo->bitrate = codecParams(stream)->bit_rate;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- streamInfo->bpcs = codecParams(stream)->bits_per_coded_sample;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- streamInfo->codec_tag = codecParams(stream)->codec_tag;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ streamInfo->bitrate = stream->codecpar->bit_rate;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ streamInfo->bpcs = stream->codecpar->bits_per_coded_sample;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ streamInfo->codec_tag = stream->codecpar->codec_tag;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ streamInfo->is_default = stream->disposition & AV_DISPOSITION_DEFAULT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ streamInfo->time_base.num = stream->time_base.num;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ streamInfo->time_base.den = stream->time_base.den;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- streamInfo->type = (QMPlay2MediaType)codecParams(stream)->codec_type; //Enumy sÄ… takie same
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ streamInfo->type = (QMPlay2MediaType)stream->codecpar->codec_type; // Enumy sÄ… takie same
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (codecParams(stream)->extradata_size)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (stream->codecpar->extradata_size)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- streamInfo->data.reserve(codecParams(stream)->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- streamInfo->data.resize(codecParams(stream)->extradata_size);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- memcpy(streamInfo->data.data(), codecParams(stream)->extradata, streamInfo->data.capacity());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- av_free(codecParams(stream)->extradata);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->extradata = (quint8 *)streamInfo->data.data();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ streamInfo->data.reserve(stream->codecpar->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ streamInfo->data.resize(stream->codecpar->extradata_size);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ memcpy(streamInfo->data.data(), stream->codecpar->extradata, streamInfo->data.capacity());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ av_free(stream->codecpar->extradata);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ stream->codecpar->extradata = (quint8 *)streamInfo->data.data();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (streamInfo->type != QMPLAY2_TYPE_ATTACHMENT)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -963,25 +835,25 @@ StreamInfo *FormatContext::getStreamInfo(AVStream *stream) const
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ switch (streamInfo->type)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case QMPLAY2_TYPE_AUDIO:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- streamInfo->format = getSampleFormat(stream);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- streamInfo->channels = codecParams(stream)->channels;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- streamInfo->sample_rate = codecParams(stream)->sample_rate;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- streamInfo->block_align = codecParams(stream)->block_align;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ streamInfo->format = av_get_sample_fmt_name((AVSampleFormat)stream->codecpar->format);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ streamInfo->channels = stream->codecpar->channels;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ streamInfo->sample_rate = stream->codecpar->sample_rate;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ streamInfo->block_align = stream->codecpar->block_align;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case QMPLAY2_TYPE_VIDEO:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- streamInfo->format = getPixelFormat(stream);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ streamInfo->format = av_get_pix_fmt_name((AVPixelFormat)stream->codecpar->format);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (stream->sample_aspect_ratio.num)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ streamInfo->sample_aspect_ratio = av_q2d(stream->sample_aspect_ratio);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if (codecParams(stream)->sample_aspect_ratio.num)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- streamInfo->sample_aspect_ratio = av_q2d(codecParams(stream)->sample_aspect_ratio);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- streamInfo->W = codecParams(stream)->width;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- streamInfo->H = codecParams(stream)->height;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if (stream->codecpar->sample_aspect_ratio.num)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ streamInfo->sample_aspect_ratio = av_q2d(stream->codecpar->sample_aspect_ratio);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ streamInfo->W = stream->codecpar->width;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ streamInfo->H = stream->codecpar->height;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!stillImage)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ streamInfo->FPS = av_q2d(stream->r_frame_rate);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case AVMEDIA_TYPE_ATTACHMENT:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ streamInfo->title = getTag(stream->metadata, "filename", false);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- switch (codecParams(stream)->codec_id)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (stream->codecpar->codec_id)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case AV_CODEC_ID_TTF:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ streamInfo->codec_name = "TTF";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/modules/FFmpeg/FormatContext.hpp src/modules/FFmpeg/FormatContext.hpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index f2aaa9e3..6171f89c 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/modules/FFmpeg/FormatContext.hpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/modules/FFmpeg/FormatContext.hpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -30,10 +30,6 @@ extern "C"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <libavformat/version.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVFORMAT_VERSION_INT >= 0x382400 // >= 56.36.00
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #define MP3_FAST_SEEK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct AVFormatContext;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct AVDictionary;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct AVStream;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -96,9 +92,6 @@ private:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bool isPaused, fixMkvAss;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ mutable bool isMetadataChanged;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ double lastTime, startTime;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifndef MP3_FAST_SEEK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- qint64 seekByByteOffset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bool isOneStreamOgg;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bool forceCopy;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -108,9 +101,5 @@ private:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bool artistWithTitle;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bool stillImage;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVFORMAT_VERSION_MAJOR <= 55
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- AVDictionary *metadata;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ QMutex &avcodec_mutex;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/qmplay2/CMakeLists.txt src/qmplay2/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index d29382cd..01932ce6 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/qmplay2/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/qmplay2/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -143,10 +143,10 @@ set(QMPLAY2_RESOURCES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ languages.qrc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-pkg_check_modules(LIBAVFORMAT libavformat>=55.33.100 REQUIRED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-pkg_check_modules(LIBAVCODEC libavcodec>=55.52.102 REQUIRED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-pkg_check_modules(LIBSWSCALE libswscale>=2.5.102 REQUIRED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-pkg_check_modules(LIBAVUTIL libavutil>=52.66.100 REQUIRED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++pkg_check_modules(LIBAVFORMAT libavformat>=57.40.101 REQUIRED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++pkg_check_modules(LIBAVCODEC libavcodec>=57.48.101 REQUIRED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++pkg_check_modules(LIBSWSCALE libswscale>=4.1.100 REQUIRED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++pkg_check_modules(LIBAVUTIL libavutil>=55.27.100 REQUIRED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if(USE_LIBASS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_definitions(-DQMPLAY2_LIBASS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -180,12 +180,12 @@ include_directories(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if(USE_AVRESAMPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_definitions(-DQMPLAY2_AVRESAMPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pkg_check_modules(LIBAVRESAMPLE libavresample>=1.2.0 REQUIRED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pkg_check_modules(LIBAVRESAMPLE libavresample>=4.0.0 REQUIRED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ list(APPEND LIBQMPLAY2_LIBS ${LIBAVRESAMPLE_LIBRARIES})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ include_directories(${LIBAVRESAMPLE_INCLUDE_DIRS})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ link_directories(${LIBAVRESAMPLE_LIBRARY_DIRS})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pkg_check_modules(LIBSWRESAMPLE libswresample>=0.18.100 REQUIRED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pkg_check_modules(LIBSWRESAMPLE libswresample>=2.1.100 REQUIRED)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ list(APPEND LIBQMPLAY2_LIBS ${LIBSWRESAMPLE_LIBRARIES})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ include_directories(${LIBSWRESAMPLE_INCLUDE_DIRS})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ link_directories(${LIBSWRESAMPLE_LIBRARY_DIRS})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/qmplay2/Functions.cpp src/qmplay2/Functions.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index baf5373e..35e59931 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/qmplay2/Functions.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/qmplay2/Functions.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -806,9 +806,7 @@ QString Functions::prepareFFmpegUrl(QString url, AVDictionary *&options, bool se
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!rawHeaders.isEmpty())
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ av_dict_set(&options, "headers", rawHeaders, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(56, 36, 100)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ av_dict_set(&options, "reconnect", "1", 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return url;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/qmplay2/MkvMuxer.cpp src/qmplay2/MkvMuxer.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index a011c56b..dda74c15 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/qmplay2/MkvMuxer.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/qmplay2/MkvMuxer.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -31,20 +31,7 @@ extern "C"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <cmath>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVFORMAT_VERSION_INT >= 0x392900
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- static inline AVCodecParameters *codecParams(AVStream *stream)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return stream->codecpar;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- #define HAS_CODECPAR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- static inline AVCodecContext *codecParams(AVStream *stream)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return stream->codec;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/**/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++using namespace std;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MkvMuxer::MkvMuxer(const QString &fileName, const QList<StreamInfo *> &streamsInfo)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -64,46 +51,32 @@ MkvMuxer::MkvMuxer(const QString &fileName, const QList<StreamInfo *> &streamsIn
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ stream->time_base.num = streamInfo->time_base.num;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ stream->time_base.den = streamInfo->time_base.den;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifndef HAS_CODECPAR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- stream->codec->time_base = stream->time_base;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (m_ctx->oformat->flags & AVFMT_GLOBALHEADER)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->codec_type = (AVMediaType)streamInfo->type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->codec_id = codec->id;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ stream->codecpar->codec_type = (AVMediaType)streamInfo->type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ stream->codecpar->codec_id = codec->id;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (streamInfo->data.size() > 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->extradata = (uint8_t *)av_mallocz(streamInfo->data.capacity());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->extradata_size = streamInfo->data.size();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- memcpy(codecParams(stream)->extradata, streamInfo->data.constData(), codecParams(stream)->extradata_size);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ stream->codecpar->extradata = (uint8_t *)av_mallocz(streamInfo->data.capacity());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ stream->codecpar->extradata_size = streamInfo->data.size();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ memcpy(stream->codecpar->extradata, streamInfo->data.constData(), stream->codecpar->extradata_size);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ switch (streamInfo->type)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case QMPLAY2_TYPE_VIDEO:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->width = streamInfo->W;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->height = streamInfo->H;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef HAS_CODECPAR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->format = av_get_pix_fmt(streamInfo->format);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->pix_fmt = av_get_pix_fmt(streamInfo->format);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->sample_aspect_ratio = av_d2q(streamInfo->sample_aspect_ratio, 10000);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ stream->codecpar->width = streamInfo->W;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ stream->codecpar->height = streamInfo->H;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ stream->codecpar->format = av_get_pix_fmt(streamInfo->format);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ stream->codecpar->sample_aspect_ratio = av_d2q(streamInfo->sample_aspect_ratio, 10000);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ stream->avg_frame_rate = av_d2q(streamInfo->FPS, 10000);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (streamInfo->is_default)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ stream->disposition |= AV_DISPOSITION_DEFAULT;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case QMPLAY2_TYPE_AUDIO:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->channels = streamInfo->channels;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->sample_rate = streamInfo->sample_rate;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->block_align = streamInfo->block_align;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef HAS_CODECPAR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->format = av_get_sample_fmt(streamInfo->format);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- codecParams(stream)->sample_fmt = av_get_sample_fmt(streamInfo->format);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ stream->codecpar->channels = streamInfo->channels;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ stream->codecpar->sample_rate = streamInfo->sample_rate;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ stream->codecpar->block_align = streamInfo->block_align;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ stream->codecpar->format = av_get_sample_fmt(streamInfo->format);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/qmplay2/NetworkAccess.cpp src/qmplay2/NetworkAccess.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 6cc81dd9..a5fd2e12 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/qmplay2/NetworkAccess.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/qmplay2/NetworkAccess.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -135,7 +135,6 @@ private:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ switch (ret)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(54, 15, 100)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case AVERROR_HTTP_BAD_REQUEST:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m_error = NetworkReply::Error::Connection400;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -154,7 +153,6 @@ private:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case AVERROR_HTTP_SERVER_ERROR:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m_error = NetworkReply::Error::Connection5XX;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ continue; // Continue if server error (e.g. Service Temporarily Unavailable)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m_error = NetworkReply::Error::Connection;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ continue; // Continue if connection error
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/multimedia/QMPlay2/files/0007-Fix-Qt-paths.patch b/multimedia/QMPlay2/files/0007-Fix-Qt-paths.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..d19b9f28808
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/multimedia/QMPlay2/files/0007-Fix-Qt-paths.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,41 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 8f1bb288f366d2c5414861473fab6e21fd59ce29 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Sergey Fedorov <vital.had@gmail.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Mon, 25 Dec 2023 15:58:27 +0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH] Fix Qt paths
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/gui/CMakeLists.txt src/gui/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 1ee4f913..85568be3 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/gui/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/gui/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -216,11 +216,8 @@ if(WIN32)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ elseif(APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ install(TARGETS ${PROJECT_NAME} BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(QT_LIBS_DIR "${Qt5Widgets_DIR}/../..")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(QT_PLUGINS_DIR "${QT_LIBS_DIR}/../plugins")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- install(FILES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "${QT_PLUGINS_DIR}/platforms/libqcocoa.dylib"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- DESTINATION "${MAC_BUNDLE_PATH}/Contents/plugins/platforms")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set(QT_LIBS_DIR "@qt_libs_dir@")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set(QT_PLUGINS_DIR "@qt_plugins_dir@")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ install(FILES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "${QT_PLUGINS_DIR}/iconengines/libqsvgicon.dylib"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DESTINATION "${MAC_BUNDLE_PATH}/Contents/plugins/iconengines")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -234,16 +231,7 @@ elseif(APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DESTINATION "${MAC_BUNDLE_PATH}/Contents"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ FILES_MATCHING
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PATTERN "qtbase_*.qm")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- install(CODE "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- include(BundleUtilities)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(BU_CHMOD_BUNDLE_ITEMS ON)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- list(APPEND DIRS /usr/local/lib ${QT_LIBS_DIR})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- file(GLOB_RECURSE QMPLAY2_MODULES_AND_QT_PLUGINS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- \"${MAC_BUNDLE_PATH}/Contents/MacOS/modules/*\"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- \"${MAC_BUNDLE_PATH}/Contents/plugins/*.dylib\")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- file(WRITE \"${MAC_BUNDLE_PATH}/Contents/Resources/qt.conf\")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- fixup_bundle(${MAC_BUNDLE_PATH} \"\${QMPLAY2_MODULES_AND_QT_PLUGINS}\" \"\${DIRS}\")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ file(WRITE \"@destroot@${MAC_BUNDLE_PATH}/Contents/Resources/qt.conf\")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # executable
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/multimedia/QMPlay2/files/2001-Fix-Qt-paths.patch b/multimedia/QMPlay2/files/2001-Fix-Qt-paths.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..4fb9a7fcfe5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/multimedia/QMPlay2/files/2001-Fix-Qt-paths.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,47 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 3cbc61634d8b30a34166630d254ad84e747038b7 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Sergey Fedorov <vital.had@gmail.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Mon, 25 Dec 2023 07:25:56 +0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH] Fix Qt paths
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/gui/CMakeLists.txt src/gui/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 33a67ac1..6bac8fa0 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/gui/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/gui/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -238,8 +239,8 @@ if(WIN32)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ elseif(APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ install(TARGETS ${PROJECT_NAME} BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(QT_LIBS_DIR "${${QT_PREFIX}Widgets_DIR}/../..")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(QT_PLUGINS_DIR "${QT_LIBS_DIR}/../plugins")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set(QT_LIBS_DIR "@qt_libs_dir@")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set(QT_PLUGINS_DIR "@qt_plugins_dir@")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ install(FILES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "${QT_PLUGINS_DIR}/platforms/libqcocoa.dylib"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DESTINATION "${MAC_BUNDLE_PATH}/Contents/plugins/platforms")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -260,23 +261,14 @@ elseif(APPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DESTINATION "${MAC_BUNDLE_PATH}/Contents"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ FILES_MATCHING
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PATTERN "qtbase_*.qm")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if(EXISTS "/usr/local/bin/ffmpeg")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(EXISTS "@prefix@/bin/ffmpeg")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ install(PROGRAMS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "/usr/local/bin/ffmpeg"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "@prefix@/bin/ffmpeg"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DESTINATION "${MAC_BUNDLE_PATH}/Contents/MacOS")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ message(WARNING "FFmpeg executable not copied!")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- install(CODE "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- include(BundleUtilities)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set(BU_CHMOD_BUNDLE_ITEMS ON)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- list(APPEND DIRS /usr/local/lib ${QT_LIBS_DIR})
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- file(GLOB_RECURSE QMPLAY2_MODULES_AND_QT_PLUGINS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- \"${MAC_BUNDLE_PATH}/Contents/MacOS/modules/*\"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- \"${MAC_BUNDLE_PATH}/Contents/plugins/*.dylib\")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- file(WRITE \"${MAC_BUNDLE_PATH}/Contents/Resources/qt.conf\")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- fixup_bundle(${MAC_BUNDLE_PATH} \"\${QMPLAY2_MODULES_AND_QT_PLUGINS}\" \"\${DIRS}\")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ file(WRITE \"@destroot@${MAC_BUNDLE_PATH}/Contents/Resources/qt.conf\")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # executable
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
</span></pre><pre style='margin:0'>
</pre>