Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5, 6.6, 6.7
-
None
-
-
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.