Return to lobby when the video is stalled

This commit is contained in:
Guillaume Meunier
2024-02-18 09:03:46 +01:00
parent 554b62e643
commit 8d408c0792
5 changed files with 28 additions and 12 deletions
+5 -2
View File
@@ -230,11 +230,11 @@ void scenes::stream::push_blit_handle(shard_accumulator * decoder, std::shared_p
}
}
if (!ready_ && std::all_of(decoders.begin(), decoders.end(), [](accumulator_images & i) {
if (state_ != state::streaming && std::all_of(decoders.begin(), decoders.end(), [](accumulator_images & i) {
return i.latest_frames.back();
}))
{
ready_ = true;
state_ = state::streaming;
first_frame_time = application::now();
spdlog::info("Stream scene ready at t={}", first_frame_time);
}
@@ -465,6 +465,9 @@ void scenes::stream::render(XrTime predicted_display_time, bool should_render)
return;
}
if (state_ == state::stalled)
application::pop_scene();
session.begin_frame();
auto [flags, views] = session.locate_views(viewconfig, predicted_display_time, world_space);