Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.3, 6.4
-
None
-
-
7c55a711cf (qt/qtmultimedia/dev) 7c55a711cf (qt/tqtc-qtmultimedia/dev) 5196cc4c58 (qt/qtmultimedia/6.4) 5196cc4c58 (qt/tqtc-qtmultimedia/6.4)
Description
QAudioSink can not properly be moved to another thread with QObject::moveToThread(QThread*) on windows because the internal QWindowsAudioSink class (which is the d-pointer in QAudioSink) has a QTimer since 234f3b042dce93d261a67c3c79bec3ba2912ae9e (Qt6.3.0 and 5.15.0 by piotr) without a proper parent and therefore is not moved to the new thread. This will lead to error messages when calling e.g. start() and slots executing in the wrong thread.
From my pov a solution would be to pass the correct parent through QPlatformMediaDevices::audioOutputDevice() and QPlatformMediaDevices::createAudioSink() to the ctor of QWindowsAudioSink.
Originally discussed in the forum: https://forum.qt.io/topic/140465/qt-6-x-qaudiosink-potential-bug