X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=server.cpp;h=d81181806f101c340fae84a5da8f02e20f6f9190;hb=cf42ca89d3a6853caec15f032bab502f31a089dd;hp=a418d1c660d409b0ea85162696f9a33de01dc330;hpb=52d37b2815f4b144fbac899b7f9548353a6fbe3c;p=cubemap diff --git a/server.cpp b/server.cpp index a418d1c..d811818 100644 --- a/server.cpp +++ b/server.cpp @@ -473,16 +473,17 @@ 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; } 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); + stream->put_client_to_sleep(client); return; } case Client::WAITING_FOR_KEYFRAME: {