diff options
author | Artem Dyomin <artem.dyomin@qt.io> | 2023-04-27 12:31:11 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-05-16 10:46:11 +0000 |
commit | 7e091c29d7c863306d3d49b7630437f52d6e934f (patch) | |
tree | ab273365e0239b42a1358b55c64decd1eebf5723 /src/multimedia/windows/qwindowsaudiosink_p.h | |
parent | faf93aa16e7223b604637a62eaf82dfe867a52ee (diff) | |
download | qtmultimedia-7e091c29d7c863306d3d49b7630437f52d6e934f.tar.gz |
Fix QAudioSink on Windows and make the auto tests pass
Windows tests became working, but on CI they are still
not available since there're no audio devices on Win CI.
- use QPointer for IO device
(a corner case for close() in the destructor)
- fix the method reset(), it should close the sink and
change the state
- There's a bunch of futher improvements to be done,
namely, stop() should be improved for having more
accurate behavior.
Change-Id: I575a1d97d6d07564164c8b2de91166315d8f28d7
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 44067974d2ba15c323f8146d619f67390d3042b8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/multimedia/windows/qwindowsaudiosink_p.h')
-rw-r--r-- | src/multimedia/windows/qwindowsaudiosink_p.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/multimedia/windows/qwindowsaudiosink_p.h b/src/multimedia/windows/qwindowsaudiosink_p.h index 95bc05e11..1178d8ad0 100644 --- a/src/multimedia/windows/qwindowsaudiosink_p.h +++ b/src/multimedia/windows/qwindowsaudiosink_p.h @@ -23,6 +23,7 @@ #include <QtCore/qdatetime.h> #include <QtCore/qmutex.h> #include <QtCore/qtimer.h> +#include <QtCore/qpointer.h> #include <QtMultimedia/qaudio.h> #include <QtMultimedia/qaudiodevice.h> @@ -48,7 +49,7 @@ public: QAudioFormat format() const override; QIODevice* start() override; void start(QIODevice* device) override; - void stop() override { close(); } + void stop() override; void reset() override; void suspend() override; void resume() override; @@ -83,7 +84,7 @@ private: qreal m_volume = 1.0; QTimer *m_timer = nullptr; QScopedPointer<QIODevice> m_pushSource; - QIODevice *m_pullSource = nullptr; + QPointer<QIODevice> m_pullSource; QComPtr<IMMDevice> m_device; QComPtr<IAudioClient> m_audioClient; QComPtr<IAudioRenderClient> m_renderClient; |