From ba9a685a55cc76cbd8bd31cefbabdcb6677ed251 Mon Sep 17 00:00:00 2001 From: Tarja Sundqvist Date: Wed, 6 Apr 2022 17:57:34 +0300 Subject: Bump version --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index 213056f59..5e6fec742 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -2,4 +2,4 @@ load(qt_build_config) DEFINES += QT_NO_FOREACH QT_NO_JAVA_STYLE_ITERATORS QT_NO_LINKED_LIST -MODULE_VERSION = 5.15.9 +MODULE_VERSION = 5.15.10 -- cgit v1.2.3 From fd8b8107e333330d03d7b354503203a6c3ffe722 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 12 Apr 2022 10:30:36 +0200 Subject: Initialize m_material to nullptr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This ensures that on non macOS platforms that it will create a new material when required. Fixes: QTBUG-102316 Fixes: QTBUG-102413 Change-Id: Iaec9c7a5950f19bf0de046e4052234fe26472342 Reviewed-by: Tor Arne Vestbø --- src/qtmultimediaquicktools/qsgvideonode_texture_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qtmultimediaquicktools/qsgvideonode_texture_p.h b/src/qtmultimediaquicktools/qsgvideonode_texture_p.h index fae3ba38b..d7fb0a4fd 100644 --- a/src/qtmultimediaquicktools/qsgvideonode_texture_p.h +++ b/src/qtmultimediaquicktools/qsgvideonode_texture_p.h @@ -74,7 +74,7 @@ public: private: QVideoSurfaceFormat m_format; - QSGVideoMaterial_Texture *m_material; + QSGVideoMaterial_Texture *m_material = nullptr; QVideoFrame m_frame; }; -- cgit v1.2.3 From 1296351d60ee6f64888bc2181b46d864f51d2201 Mon Sep 17 00:00:00 2001 From: Axel Spoerl Date: Tue, 10 May 2022 17:41:23 +0200 Subject: Fix chunk sizing in QPulseAudioSink QPulseAudioSink:write() takes a length parameter which is set to the qMin of itself and the return value of pa_stream_writable_size(). This method returns the number of bytes requested by the server, but not yet written. Unless data is buffered, the value is 0. That leads to length being set to 0 and no data being sent. In PulseOutputPrivate::writeData(), a loop was implemented calling QPulseAudioSink::write() up to 10 times for each data chunk. That forced data buffering and subsequently the return value of pa_stream_writable_size() to be > 0. This patch replaces the query of pa_stream_writable_size() with the nbytes value modified by pa_stream_begin_write(). It represents the maximum amount of bytes the pulseaudio server is ready to accept. The patch also removes the loop calling write up to 10 times as it becomes unnecessary. Fixes: QTBUG-60575 Change-Id: I316a5ac610c8540ab8f7fff4a3b0b1ee3d7e7ad5 Reviewed-by: Lars Knoll (cherry picked from commit f1829a24d4c9a393f95d55c415daa80275a90b93) Reviewed-by: Qt CI Bot --- src/plugins/pulseaudio/qaudiooutput_pulse.cpp | 36 +++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/plugins/pulseaudio/qaudiooutput_pulse.cpp b/src/plugins/pulseaudio/qaudiooutput_pulse.cpp index 9526c7d67..f5edafd41 100644 --- a/src/plugins/pulseaudio/qaudiooutput_pulse.cpp +++ b/src/plugins/pulseaudio/qaudiooutput_pulse.cpp @@ -506,27 +506,30 @@ qint64 QPulseAudioOutput::write(const char *data, qint64 len) pulseEngine->lock(); - len = qMin(len, static_cast(pa_stream_writable_size(m_stream))); + size_t nbytes = len; + void *dest = nullptr; + + if (pa_stream_begin_write(m_stream, &dest, &nbytes) < 0) { + qWarning("QAudioSink(pulseaudio): pa_stream_begin_write, error = %s", + pa_strerror(pa_context_errno(pulseEngine->context()))); + setError(QAudio::IOError); + return 0; + } + + len = qMin(len, qint64(nbytes)); if (m_volume < 1.0f) { // Don't use PulseAudio volume, as it might affect all other streams of the same category // or even affect the system volume if flat volumes are enabled - void *dest = NULL; - size_t nbytes = len; - if (pa_stream_begin_write(m_stream, &dest, &nbytes) < 0) { - qWarning("QAudioOutput(pulseaudio): pa_stream_begin_write, error = %s", - pa_strerror(pa_context_errno(pulseEngine->context()))); - setError(QAudio::IOError); - return 0; - } - - len = int(nbytes); QAudioHelperInternal::qMultiplySamples(m_volume, m_format, data, dest, len); - data = reinterpret_cast(dest); + } else { + memcpy(dest, data, len); } - if (pa_stream_write(m_stream, data, len, NULL, 0, PA_SEEK_RELATIVE) < 0) { - qWarning("QAudioOutput(pulseaudio): pa_stream_write, error = %s", + data = reinterpret_cast(dest); + + if ((pa_stream_write(m_stream, data, len, nullptr, 0, PA_SEEK_RELATIVE)) < 0) { + qWarning("QAudioSink(pulseaudio): pa_stream_write, error = %s", pa_strerror(pa_context_errno(pulseEngine->context()))); setError(QAudio::IOError); return 0; @@ -683,7 +686,6 @@ qint64 PulseOutputPrivate::readData(char *data, qint64 len) qint64 PulseOutputPrivate::writeData(const char *data, qint64 len) { - int retry = 0; qint64 written = 0; if ((m_audioDevice->m_deviceState == QAudio::ActiveState @@ -691,10 +693,8 @@ qint64 PulseOutputPrivate::writeData(const char *data, qint64 len) while(written < len) { int chunk = m_audioDevice->write(data+written, (len-written)); if (chunk <= 0) - retry++; - written+=chunk; - if (retry > 10) return written; + written+=chunk; } } -- cgit v1.2.3