fix: pause support + old message skip + stopCurrentPcm

- SoundManager: added stopCurrentPcm() for pause/stop of PCM playback
- messagedelegate: call stopCurrentPcm on pause, new play, and timer complete
- messagelist: skip old double-nested JSON messages (raw starts with '{')
- sound_manager.h: void* for ma_audio_buffer to avoid header dependency
This commit is contained in:
Evgeny committed 2026-07-27 00:38:15 +03:00
1 parent d9d1bfe141
commit beb20082e2
5 files changed
+38 -16

No files matched your search

+4
View File
@@ -97,6 +97,10 @@ static void setVoiceMessageRoles(QStandardItem* item, const QByteArray& data,
if (ct == "audio/opus") {
QString raw = QString::fromUtf8(data);
int pipe = raw.indexOf('|');
if (pipe < 0 && raw.startsWith('{')) {
/* old double-nested JSON from before the fix — skip */
return;
}
QString fname = pipe >= 0 ? raw.left(pipe) : raw;
QString dur = pipe >= 0 ? raw.mid(pipe + 1) : QString();
if (!dur.isEmpty()) item->setData(dur + "s", MsgVoiceDurationRole);