Fixed HLS playback in Apple products (tested on Mac version of Quicktime).
This commit is contained in:
parent
cbb9b52d1c
commit
d0040e9b41
2 changed files with 18 additions and 16 deletions
|
@ -406,7 +406,6 @@ namespace Connector_HTTP {
|
|||
std::cout << "Completed request (" << conn->getSocket() << ") " << handler << " in " << (Util::getMS() - startms) << " ms" << std::endl;
|
||||
#endif
|
||||
if (closeConnection){
|
||||
fprintf( stderr, "Called for connection close\n" );
|
||||
break;
|
||||
}
|
||||
Client.Clean(); //clean for any possible next requests
|
||||
|
|
|
@ -71,7 +71,7 @@ namespace Connector_HTTP {
|
|||
}else{
|
||||
Result << "#EXTM3U\r\n"
|
||||
"#EXT-X-VERSION:4\r\n"
|
||||
"#EXT-X-MEDIA-SEQUENCE:1\r\n"
|
||||
"#EXT-X-MEDIA-SEQUENCE:0\r\n"
|
||||
"#EXT-X-TARGETDURATION:" << ((metadata["video"]["keyms"].asInt() + metadata["video"]["keyvar"].asInt()) / 1000) + 1 << "\r\n";
|
||||
}
|
||||
#if DEBUG >= 8
|
||||
|
@ -183,10 +183,9 @@ namespace Connector_HTTP {
|
|||
}
|
||||
std::string manifest = BuildIndex(streamname, Strm.metadata);
|
||||
HTTP_S.SetBody(manifest);
|
||||
fprintf( stderr, "%s\n", HTTP_S.GetHeader( "Content-Type" ).c_str() );
|
||||
conn.SendNow(HTTP_S.BuildResponse("200", "OK"));
|
||||
#if DEBUG >= 3
|
||||
printf("Sent manifest\n");
|
||||
printf("Sent index\n");
|
||||
#endif
|
||||
pending_manifest = false;
|
||||
}else{
|
||||
|
@ -243,14 +242,15 @@ fprintf( stderr, "%s\n", HTTP_S.GetHeader( "Content-Type" ).c_str() );
|
|||
}
|
||||
if (pending_manifest){
|
||||
HTTP_S.Clean();
|
||||
HTTP_S.protocol = "HTTP/1.1";
|
||||
HTTP_S.SetHeader("Cache-Control", "no-cache");
|
||||
if (Strm.metadata.isMember("length")){
|
||||
receive_marks = true;
|
||||
}
|
||||
std::string manifest = BuildIndex(streamname, Strm.metadata);
|
||||
HTTP_S.SetHeader("Content-Type", manifestType);
|
||||
HTTP_S.SetHeader("Connection", "keep-alive");
|
||||
HTTP_S.SetBody(manifest);
|
||||
fprintf( stderr, "%s\n", HTTP_S.GetHeader( "Content-Type" ).c_str() );
|
||||
conn.SendNow(HTTP_S.BuildResponse("200", "OK"));
|
||||
#if DEBUG >= 3
|
||||
printf("Sent manifest\n");
|
||||
|
@ -270,7 +270,9 @@ fprintf( stderr, "%s\n", HTTP_S.GetHeader( "Content-Type" ).c_str() );
|
|||
fprintf(stderr, "Sending a fragment...");
|
||||
#endif
|
||||
HTTP_S.Clean();
|
||||
HTTP_S.SetHeader("Content-Type", "video/MP2T");
|
||||
HTTP_S.protocol = "HTTP/1.1";
|
||||
HTTP_S.SetHeader("Content-Type", "video/mp2t");
|
||||
HTTP_S.SetHeader("Connection", "keep-alive");
|
||||
HTTP_S.SetBody("");
|
||||
HTTP_S.SetHeader("Content-Length", TSBuf.str().size());
|
||||
conn.SendNow(HTTP_S.BuildResponse("200", "OK"));
|
||||
|
@ -384,17 +386,18 @@ fprintf( stderr, "%s\n", HTTP_S.GetHeader( "Content-Type" ).c_str() );
|
|||
}
|
||||
if (pending_manifest && !Strm.metadata.isNull()){
|
||||
HTTP_S.Clean();
|
||||
HTTP_S.protocol = "HTTP/1.1";
|
||||
HTTP_S.SetHeader("Cache-Control", "no-cache");
|
||||
if (Strm.metadata.isMember("length")){
|
||||
receive_marks = true;
|
||||
}
|
||||
HTTP_S.SetHeader("Content-Type", manifestType);
|
||||
HTTP_S.SetHeader("Connection", "keep-alive");
|
||||
std::string manifest = BuildIndex(streamname, Strm.metadata);
|
||||
HTTP_S.SetBody(manifest);
|
||||
fprintf( stderr, "%s\n", HTTP_S.GetHeader( "Content-Type" ).c_str() );
|
||||
conn.SendNow(HTTP_S.BuildResponse("200", "OK"));
|
||||
#if DEBUG >= 3
|
||||
printf("Sent manifest\n");
|
||||
printf("Sent index\n");
|
||||
#endif
|
||||
pending_manifest = false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue