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

COM is uninitialized too many times with FFmpeg and QWindowsResampler

    XMLWordPrintable

Details

    • Windows
    • 6e8b92e5a (dev), 21566ce27 (6.7), 3a83c12a5 (6.6), 19069cab9 (tqtc/lts-6.5), 751ca5e5b (dev)

    Description

      At construction, QFFmpegAudioInput creates a QAudioSource, and moves it
      to a worker thread. The QAudioSource will then create a
      QWindowsResampler which is designed to initialize COM on this worker
      thread in its constructor and uninitialize COM in its destructor. This
      is needed because the QWindowsResampler uses Windows Media Foundation.

      The problem is that destruction of the QWindowsResampler input is not
      performed on the worker thread, but on the main thread.
      QWindowsResampler's destructor will therefore unintentionally
      uninitialize COM on the main thread, not on the worker thread. This
      leads to uninitializing COM one time too many on the main thread.

      During destruction of static variables, any COM calls related to for
      example Windows Media Foundation can therefore be made from a main
      thread that is no longer initialized for COM.

      It is unclear what consequences this can have, but initialization of the
      COM runtime should match up with uninitialization on the same thread.

       

      Attachments

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

        Activity

          People

            johanseg Jøger Hansegård
            johanseg Jøger Hansegård
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: