X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=server.cpp;h=946dc5d1df12d0c5b9c3d88058c0b5dad68c5a8d;hb=2fbbdf3c4a4ffd2d90c102a37c7a02b5b6f80216;hp=7116a73f7e8ab9a3bf3fec9d6973275aa0f23307;hpb=8095c4ac52431d9e593ece77bdc21566a2ed9240;p=cubemap diff --git a/server.cpp b/server.cpp index 7116a73..946dc5d 100644 --- a/server.cpp +++ b/server.cpp @@ -479,14 +479,15 @@ sending_header_or_error_again: } case Client::WAITING_FOR_KEYFRAME: { Stream *stream = client->stream; - if (ssize_t(client->stream_pos) > stream->last_suitable_starting_point) { + if (stream->suitable_starting_points.empty() || + client->stream_pos > stream->suitable_starting_points.back()) { // We haven't received a keyframe since this stream started waiting, // so keep on waiting for one. // This is postcondition #3. stream->put_client_to_sleep(client); return; } - client->stream_pos = stream->last_suitable_starting_point; + client->stream_pos = stream->suitable_starting_points.back(); client->state = Client::PREBUFFERING; // Fall through. }