Preserve voice autoplay ordering while decoding in a worker
This commit is contained in:
1 parent
172cc3a649
commit
318d72708c
3 files changed
+6
-3
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user