From b5aa7e6874a403b1d37b5ce47661d0f81952f443 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 4 May 2021 10:31:40 +0200 Subject: Fix bugs in QSoundEffect Those lead to sound effects not being played back. Also, the audiodecoder example would not close the wav decoder, leading to invalid sizes defined inside the wav file. There's still a bug left that causes the playback to be chopped into chunks, but that seems to be a separate problem inside the gstreamer code base. Change-Id: Id432e7ded128bd2cc0253e12bba06a1595900a3d Reviewed-by: Doris Verria Reviewed-by: Lars Knoll --- examples/multimedia/audiodecoder/audiodecoder.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/multimedia/audiodecoder/audiodecoder.cpp b/examples/multimedia/audiodecoder/audiodecoder.cpp index 36bbb2919..4f9232b2c 100644 --- a/examples/multimedia/audiodecoder/audiodecoder.cpp +++ b/examples/multimedia/audiodecoder/audiodecoder.cpp @@ -53,7 +53,8 @@ #include AudioDecoder::AudioDecoder(bool isPlayback, bool isDelete, const QString &targetFileName) - : m_cout(stdout, QIODevice::WriteOnly) + : m_cout(stdout, QIODevice::WriteOnly), + m_targetFilename(targetFileName) { m_isPlayback = isPlayback; m_isDelete = isDelete; @@ -168,6 +169,7 @@ void AudioDecoder::stateChanged(QAudioDecoder::State newState) void AudioDecoder::finished() { + m_waveDecoder->close(); m_cout << "Decoding finished\n"; if (m_isPlayback) { -- cgit v1.2.3