Update HTTP TS output to use new HTTP handler

This commit is contained in:
Thulinma 2023-07-06 01:58:41 +02:00
parent d63190387a
commit 0783c11663
2 changed files with 8 additions and 20 deletions

View file

@ -111,27 +111,15 @@ namespace Mist{
bool OutHTTPTS::isRecording(){return config->getString("target").size();}
void OutHTTPTS::onHTTP(){
std::string method = H.method;
initialize();
H.clearHeader("Range");
H.clearHeader("Icy-MetaData");
H.clearHeader("User-Agent");
H.clearHeader("Host");
H.clearHeader("Accept-Ranges");
H.clearHeader("transferMode.dlna.org");
H.SetHeader("Content-Type", "video/mpeg");
H.setCORSHeaders();
if (method == "OPTIONS" || method == "HEAD"){
void OutHTTPTS::respondHTTP(const HTTP::Parser & req, bool headersOnly){
HTTPOutput::respondHTTP(req, headersOnly);
H.protocol = "HTTP/1.0";
H.SendResponse("200", "OK", myConn);
H.Clean();
return;
}
H.protocol = "HTTP/1.0"; // Force HTTP/1.0 because some devices just don't understand chunked replies
H.StartResponse(H, myConn);
if (!headersOnly){
parseData = true;
wantRequest = false;
}
}
void OutHTTPTS::sendTS(const char *tsData, size_t len){
if (isRecording()){

View file

@ -7,7 +7,7 @@ namespace Mist{
OutHTTPTS(Socket::Connection &conn);
~OutHTTPTS();
static void init(Util::Config *cfg);
void onHTTP();
void respondHTTP(const HTTP::Parser & req, bool headersOnly);
void sendTS(const char *tsData, size_t len = 188);
void initialSeek(bool dryRun = false);