Added improved HLS output error handling
This commit is contained in:
parent
dfb308aac7
commit
09d4bb6318
2 changed files with 16 additions and 0 deletions
|
@ -342,4 +342,19 @@ namespace Mist {
|
|||
void OutHLS::sendTS(const char * tsData, unsigned int len){
|
||||
H.Chunkify(tsData, len, myConn);
|
||||
}
|
||||
|
||||
void OutHLS::onFail(const std::string & msg, bool critical){
|
||||
if (H.url.find(".m3u") == std::string::npos){
|
||||
HTTPOutput::onFail(msg, critical);
|
||||
return;
|
||||
}
|
||||
H.Clean(); //make sure no parts of old requests are left in any buffers
|
||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
||||
H.setCORSHeaders();
|
||||
H.SetHeader("Content-Type", "application/vnd.apple.mpegurl");
|
||||
H.SetHeader("Cache-Control", "no-cache");
|
||||
H.SetBody("#EXTM3U\r\n#EXT-X-ERROR: "+msg+"\r\n#EXT-X-ENDLIST\r\n");
|
||||
H.SendResponse("200", "OK", myConn);
|
||||
Output::onFail(msg, critical);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ namespace Mist {
|
|||
void sendNext();
|
||||
void onHTTP();
|
||||
bool isReadyForPlay();
|
||||
virtual void onFail(const std::string & msg, bool critical = false);
|
||||
protected:
|
||||
std::string h264init(const std::string & initData);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue