summaryrefslogtreecommitdiffstats
path: root/examples/multimediawidgets/camera/doc/src
diff options
context:
space:
mode:
authorAxel Spoerl <axel.spoerl@qt.io>2022-05-10 17:41:23 +0200
committerAxel Spoerl <axel.spoerl@qt.io>2022-05-12 14:28:37 +0200
commit1296351d60ee6f64888bc2181b46d864f51d2201 (patch)
tree2f2825bff9bfdf6cb6848a4123fd0d061f824e4d /examples/multimediawidgets/camera/doc/src
parentfd8b8107e333330d03d7b354503203a6c3ffe722 (diff)
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 <lars.knoll@qt.io> (cherry picked from commit f1829a24d4c9a393f95d55c415daa80275a90b93) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'examples/multimediawidgets/camera/doc/src')
0 files changed, 0 insertions, 0 deletions