summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2020-06-09 21:14:47 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2020-06-10 19:52:30 +0200
commit79b01c63e8883b87f27772a20e07116f6af97d15 (patch)
tree76f5dece914b12797f82faa37a7f4c6fde611d8a /dev-qt/qtmultimedia
parentdev-qt/qtnetwork: Fix CVE-2020-13962 (diff)
downloadgentoo-79b01c63e8883b87f27772a20e07116f6af97d15.tar.gz
gentoo-79b01c63e8883b87f27772a20e07116f6af97d15.tar.bz2
gentoo-79b01c63e8883b87f27772a20e07116f6af97d15.zip
dev-qt/qtmultimedia: Gstreamer: fix stream buffering
Package-Manager: Portage-2.3.100, Repoman-2.3.22 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'dev-qt/qtmultimedia')
-rw-r--r--dev-qt/qtmultimedia/files/qtmultimedia-5.14.2-gstreamer-buffering.patch38
-rw-r--r--dev-qt/qtmultimedia/qtmultimedia-5.14.2-r1.ebuild72
2 files changed, 110 insertions, 0 deletions
diff --git a/dev-qt/qtmultimedia/files/qtmultimedia-5.14.2-gstreamer-buffering.patch b/dev-qt/qtmultimedia/files/qtmultimedia-5.14.2-gstreamer-buffering.patch
new file mode 100644
index 000000000000..5d17b079613d
--- /dev/null
+++ b/dev-qt/qtmultimedia/files/qtmultimedia-5.14.2-gstreamer-buffering.patch
@@ -0,0 +1,38 @@
+From d8d072417b08dd75734b3f0aa86c3a49db934770 Mon Sep 17 00:00:00 2001
+From: Roman Valov <roman.valov@gmail.com>
+Date: Mon, 13 Apr 2020 12:54:09 +0000
+Subject: [PATCH] Gstreamer: fix stream buffering
+
+Gstreamer client should handle GST_MESSAGE_BUFFERING to play and pause
+streams based on buffer-percent value and Qt does it properly.
+However `updateSessionState` of QGstreamerPlayerControl was implemented
+to go back into playing state each time session state becomes paused.
+That behavior resulted into choppy stream playback.
+Fix with condition to un-pause playback only if it's already buffered.
+
+Fixes: QTBUG-83417
+Change-Id: Ida4a9e2e196de00050bdc64725fa818c7e939785
+Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
+---
+ src/gsttools/qgstreamerplayercontrol.cpp | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/gsttools/qgstreamerplayercontrol.cpp b/src/gsttools/qgstreamerplayercontrol.cpp
+index 165978288..d65102e2f 100644
+--- a/src/gsttools/qgstreamerplayercontrol.cpp
++++ b/src/gsttools/qgstreamerplayercontrol.cpp
+@@ -439,8 +439,10 @@ void QGstreamerPlayerControl::updateSessionState(QMediaPlayer::State state)
+ }
+ m_pendingSeekPosition = -1;
+
+- if (m_currentState == QMediaPlayer::PlayingState)
+- m_session->play();
++ if (m_currentState == QMediaPlayer::PlayingState) {
++ if (m_mediaStatus == QMediaPlayer::BufferedMedia)
++ m_session->play();
++ }
+ }
+
+ updateMediaStatus();
+--
+2.16.3
diff --git a/dev-qt/qtmultimedia/qtmultimedia-5.14.2-r1.ebuild b/dev-qt/qtmultimedia/qtmultimedia-5.14.2-r1.ebuild
new file mode 100644
index 000000000000..57c260a9bee9
--- /dev/null
+++ b/dev-qt/qtmultimedia/qtmultimedia-5.14.2-r1.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit qt5-build
+
+DESCRIPTION="Multimedia (audio, video, radio, camera) library for the Qt5 framework"
+
+if [[ ${QT5_BUILD_TYPE} == release ]]; then
+ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+fi
+
+IUSE="alsa gles2-only gstreamer openal pulseaudio qml widgets"
+
+RDEPEND="
+ ~dev-qt/qtcore-${PV}
+ ~dev-qt/qtgui-${PV}[gles2-only=]
+ ~dev-qt/qtnetwork-${PV}
+ alsa? ( media-libs/alsa-lib )
+ gstreamer? (
+ dev-libs/glib:2
+ media-libs/gstreamer:1.0
+ media-libs/gst-plugins-bad:1.0
+ media-libs/gst-plugins-base:1.0
+ )
+ pulseaudio? ( media-sound/pulseaudio[glib] )
+ qml? (
+ ~dev-qt/qtdeclarative-${PV}
+ gles2-only? ( ~dev-qt/qtgui-${PV}[egl] )
+ openal? ( media-libs/openal )
+ )
+ widgets? (
+ ~dev-qt/qtopengl-${PV}
+ ~dev-qt/qtwidgets-${PV}[gles2-only=]
+ )
+"
+DEPEND="${RDEPEND}
+ gstreamer? ( x11-base/xorg-proto )
+"
+
+PATCHES=(
+ "${FILESDIR}/${P}-gstreamer-buffering.patch" # QTBUG-83417
+)
+
+src_prepare() {
+ sed -i -e '/CONFIG\s*+=/ s/optimize_full//' \
+ src/multimedia/multimedia.pro || die
+
+ qt_use_disable_config openal openal \
+ src/imports/imports.pro
+
+ qt_use_disable_mod qml quick \
+ src/src.pro \
+ src/plugins/plugins.pro
+
+ qt_use_disable_mod widgets widgets \
+ src/src.pro \
+ src/gsttools/gsttools.pro \
+ src/plugins/gstreamer/common.pri
+
+ qt5-build_src_prepare
+}
+
+src_configure() {
+ local myqmakeargs=(
+ --
+ $(qt_use alsa)
+ $(qt_use gstreamer)
+ $(qt_use pulseaudio)
+ )
+ qt5-build_src_configure
+}