perf: coalesce superseded queued playback seeks

This commit is contained in:
2026-10-17 00:03:02 +02:00
parent 367afdfb07
commit 880b596765
9 changed files with 176 additions and 19 deletions
+7 -2
View File
@@ -234,8 +234,13 @@ struct Player {
return true;
}
}
if (commands.size() >= commandLimit) return false;
commands.push_back(std::move(command));
if (command.action == Action::Seek && !commands.empty() &&
commands.back().action == Action::Seek && commands.back().epoch == command.epoch) {
commands.back().seconds = command.seconds;
} else {
if (commands.size() >= commandLimit) return false;
commands.push_back(std::move(command));
}
if (newTimeline) requestedEpoch.store(commands.back().epoch, std::memory_order_relaxed);
if (commands.back().action == Action::Open) {
const auto revision = state.revision + 1;