Select a route frame for existing composed burst captures

This commit is contained in:
Shokunin
2026-10-21 11:34:30 -07:00
parent 8ed0fd1fe1
commit 6961be8291
+10 -2
View File
@@ -4825,7 +4825,8 @@ static void input_replay_frame_completed(uint64_t frame) {
static void input_replay_frontend_tick(uint64_t frame) {
uint64_t relative = input_replay_frame(frame);
if (relative == UINT64_MAX) return;
static uint64_t stop = 0, seconds = 0, deadline_us = 0;
static uint64_t stop = 0, seconds = 0, deadline_us = 0, shot_frame = 800;
static bool custom_shot_frame = false;
static const char *report = nullptr, *shots = nullptr;
static bool initialized = false, finished = false;
auto &work = g_replay_work;
@@ -4839,6 +4840,13 @@ static void input_replay_frontend_tick(uint64_t frame) {
}
report = std::getenv("PSX_INPUT_REPLAY_REPORT");
shots = std::getenv("PSX_INPUT_REPLAY_SHOTS");
if (const char *e = std::getenv("PSX_INPUT_REPLAY_SHOT_FRAME")) {
char *end = nullptr;
shot_frame = std::strtoull(e, &end, 10);
if (!*e || !end || *end)
throw std::runtime_error("invalid replay shot frame");
custom_shot_frame = true;
}
if (report && *report) work.resize(HOST_FRAME_STAMP_CAP);
initialized = true;
}
@@ -4854,7 +4862,7 @@ static void input_replay_frontend_tick(uint64_t frame) {
g_runtime_perf.pacer_ticks * 1000000 / hz,
(rs.backpressure_ns + rs.ring_full_ns + rs.acquire_ns) / 1000, 0};
}
if (shots && (relative == 800 || (stop > 0 && relative == stop+2))) {
if (shots && (relative == shot_frame || (!custom_shot_frame && stop > 0 && relative == stop+2))) {
char path[512];
std::snprintf(path, sizeof path, "%s-%llu.png", shots, (unsigned long long)relative);
present_shot_request(path);