summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2023-11-04 22:23:32 +0100
committerAxel Spoerl <axel.spoerl@qt.io>2023-11-06 10:17:25 +0000
commit27e7229665cba98070a3d32cdfbf9347d3f7736c (patch)
tree9ce69df384a28304c84e7397eeca317d9d302dbc /src
parent1f55a084efcd98b9780f8a9e22cbea76b6d649c8 (diff)
WinRT: fix hanging synthesize when RIFF header is removed
Amends 428cae98619584a51c01be135fecf6b347c117b3. If we drop the RIFF header bytes, then we have fewer bytes available as well, so decrease that value. Otherwise we never fetch more data. Improve the test, which should have caught this regression, by testing that synthesise cycles correctly through the states even if no default audio output is present. The test was completely skipped because of that, not detecting the regression. Fixes: QTBUG-118668 Pick-to: 6.6 Change-Id: I3b4276c13ce2c77ec718d1b7bbca6f3421636890 Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/tts/winrt/qtexttospeech_winrt_audiosource.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/tts/winrt/qtexttospeech_winrt_audiosource.cpp b/src/plugins/tts/winrt/qtexttospeech_winrt_audiosource.cpp
index 476bc15..e71f112 100644
--- a/src/plugins/tts/winrt/qtexttospeech_winrt_audiosource.cpp
+++ b/src/plugins/tts/winrt/qtexttospeech_winrt_audiosource.cpp
@@ -107,7 +107,7 @@ qint64 AudioSource::readData(char *data, qint64 maxlen)
Q_ASSERT(bufferByteAccess);
- const qint64 available = bytesInBuffer();
+ qint64 available = bytesInBuffer();
maxlen = qMin(available, maxlen);
if (!maxlen && atEnd())
@@ -127,6 +127,7 @@ qint64 AudioSource::readData(char *data, qint64 maxlen)
pbyte += WaveHeaderLength;
m_bufferOffset += WaveHeaderLength;
maxlen -= WaveHeaderLength;
+ available -= WaveHeaderLength;
}
}