Preserve voice autoplay ordering while decoding in a worker

This commit is contained in:
evgeny committed 2026-10-01 18:29:43 +03:00
1 parent 172cc3a649
commit 318d72708c
3 files changed
+6 -3

No files matched your search

+4 -3
View File
@@ -968,7 +968,7 @@ void MainWindow::autoPlayCheckNewMessage(const QString& channelId) {
}
void MainWindow::autoPlayTimerTick() {
if (SoundManager::instance()->isCurrentPcmPlaying())
if (VoicePlayer::isPreparing() || SoundManager::instance()->isCurrentPcmPlaying())
return;
while (!m_autoPlayQueue.isEmpty()) {
@@ -996,8 +996,9 @@ void MainWindow::autoPlayTimerTick() {
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "auto-play: playing ch=%s msg=%lld file=%s dur=%.1fs",
qPrintable(chId), (long long)msgId, qPrintable(fullPath), (double)dur);
MessageDelegate::stopAllAutoPlay();
float actualDur = VoicePlayer::playOpusFile(fullPath);
MessageDelegate::startAutoPlay(fullPath, actualDur);
VoicePlayer::playOpusFile(fullPath, this, [fullPath](float actualDur) {
MessageDelegate::startAutoPlay(fullPath, actualDur);
});
return;
}
}