perf: coalesce superseded queued playback seeks
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user