diff options
author | Vladimir Belyavsky <belyavskyv@gmail.com> | 2024-03-21 18:47:48 +0300 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-03-22 17:02:41 +0000 |
commit | 0d00a9b9c3f8499387198478b4e47d4a46c9ebde (patch) | |
tree | 4c69bc31c2abd6a5877b851a18f84cc68d46e6a0 | |
parent | 00f882e58d25c103924831f04f877e4a735c4d43 (diff) |
Examples: fix warning on changing device in AudioSource example
There was a warning "QIODevice::write (AudioInfo): device not open"
that appeared every time on changing the audio input device. To fix
this, we just need to stop the audio source (m_audioInput) before
closing the I/O device (m_audioInfo).
Fixes: QTBUG-123045
Pick-to: 6.5
Change-Id: I499d4e5d96e4076ab3c71444a27153b9d7642b02
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
(cherry picked from commit 2b14f2e4a96ce7cadb4d7a768172cdec09be9d6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit def8747372d137baccdf5569fb17e93f32cf5d18)
-rw-r--r-- | examples/multimedia/audiosource/audiosource.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/multimedia/audiosource/audiosource.cpp b/examples/multimedia/audiosource/audiosource.cpp index 8a06191c5..48e33fa2d 100644 --- a/examples/multimedia/audiosource/audiosource.cpp +++ b/examples/multimedia/audiosource/audiosource.cpp @@ -233,9 +233,9 @@ void InputTest::toggleSuspend() void InputTest::deviceChanged(int index) { - m_audioInfo->stop(); m_audioInput->stop(); m_audioInput->disconnect(this); + m_audioInfo->stop(); initializeAudio(m_deviceBox->itemData(index).value<QAudioDevice>()); } |