summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-05-04 10:31:40 +0200
committerLars Knoll <lars.knoll@qt.io>2021-05-07 11:11:36 +0000
commitb5aa7e6874a403b1d37b5ce47661d0f81952f443 (patch)
treee468e519ea8a55b67be937781f30182570c9c88f /examples
parent5b049e286b5e052afc9cbca1edd453fd570219f0 (diff)
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 <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/multimedia/audiodecoder/audiodecoder.cpp4
1 files changed, 3 insertions, 1 deletions
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 <stdio.h>
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) {