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
+3 -4
View File
@@ -27,9 +27,9 @@ void scenes::stream::process_packets()
{
try
{
int n = network_session->poll(*this, std::chrono::milliseconds(5000));
if (n == 0 && video_started_)
throw std::runtime_error("Timeout waiting for network packets");
int n = network_session->poll(*this, std::chrono::milliseconds(500));
if (n == 0 && state_ == state::streaming)
state_ = state::stalled;
}
catch (std::exception & e)
{
@@ -41,7 +41,6 @@ void scenes::stream::process_packets()
void scenes::stream::operator()(to_headset::video_stream_data_shard && shard)
{
video_started_ = true;
shard_queue.push(std::move(shard));
}