X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=server.cpp;h=14162f58e5a960cc37e35cb18796e270c883714e;hb=235107473ceef239747e9995365489899aa90cca;hp=a418d1c660d409b0ea85162696f9a33de01dc330;hpb=52d37b2815f4b144fbac899b7f9548353a6fbe3c;p=cubemap diff --git a/server.cpp b/server.cpp index a418d1c..14162f5 100644 --- a/server.cpp +++ b/server.cpp @@ -473,17 +473,18 @@ sending_header_or_error_again: // words, we won't send any of the backlog, but we'll start // sending immediately as we get the next keyframe block. // This is postcondition #3. + Stream *stream = client->stream; if (client->stream_pos == size_t(-2)) { client->stream_pos = std::min( - client->stream->bytes_received - client->stream->backlog_size, + stream->bytes_received - stream->backlog_size, 0); client->state = Client::SENDING_DATA; + goto sending_data; } else { - client->stream_pos = client->stream->bytes_received; + client->stream_pos = stream->bytes_received; client->state = Client::WAITING_FOR_KEYFRAME; } - client->stream->put_client_to_sleep(client); - return; + // Fall through. } case Client::WAITING_FOR_KEYFRAME: { Stream *stream = client->stream; @@ -513,6 +514,7 @@ sending_header_or_error_again: // Fall through. } case Client::SENDING_DATA: { +sending_data: skip_lost_data(client); Stream *stream = client->stream;