// (RFC 8216 4.3.3.1) and we get closer to the target by doing so.
// Note that in particular, this means we'll always extend
// as long as we don't exceed the target duration.
- double current_duration = fragments[fragments.size() - 1].pts;
+ double current_duration = pts_double - fragments[fragments.size() - 1].pts;
double candidate_duration = pts_double - fragments[fragments.size() - 2].pts;
if (lrintf(candidate_duration) <= hls_frag_duration &&
fabs(candidate_duration - hls_frag_duration) < fabs(current_duration - hls_frag_duration)) {
assert(close_after_response);
response = "HTTP/1.0 200 OK\r\n";
}
- snprintf(buf, sizeof(buf), "Content-length: %zu\r\n", playlist.size());
+ snprintf(buf, sizeof(buf), "Content-Length: %zu\r\n", playlist.size());
response.append(buf);
- response.append("Content-type: application/x-mpegURL\r\n");
+ response.append("Content-Type: application/x-mpegURL\r\n");
if (!allow_origin.empty()) {
response.append("Access-Control-Allow-Origin: ");
response.append(allow_origin);