// 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<size_t>(
- 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 should be -1, but it might not be,
- // if we have clients from an older version.
- 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;
// Fall through.
}
case Client::SENDING_DATA: {
+sending_data:
skip_lost_data(client);
Stream *stream = client->stream;