Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-108187

QAudioSink can not be moved to another thread

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.4.2, 6.5.0 Beta1
    • 6.3, 6.4
    • Multimedia
    • None
    • Windows
    • 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

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            piotr Piotr Srebrny (Inactive)
            chehrlic Christian Ehrlicher
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes