Make internal HTTP output correctly serve embed codes for newer stream types.

This commit is contained in:
Thulinma 2015-07-21 23:07:41 +02:00
parent c3efc1001f
commit fce83c903b

View file

@ -232,7 +232,7 @@ namespace Mist {
H.Clean(); H.Clean();
H.SetHeader("Content-Type", "application/smil"); H.SetHeader("Content-Type", "application/smil");
H.SetHeader("Server", "mistserver/" PACKAGE_VERSION "/" + Util::Config::libver); H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
H.setCORSHeaders(); H.setCORSHeaders();
H.SetBody("<smil>\n <head>\n <meta base='rtmp://" + host + ":" + port + url_rel + "' />\n </head>\n <body>\n <switch>\n"+trackSources+" </switch>\n </body>\n</smil>"); H.SetBody("<smil>\n <head>\n <meta base='rtmp://" + host + ":" + port + url_rel + "' />\n </head>\n <body>\n <switch>\n"+trackSources+" </switch>\n </body>\n</smil>");
H.SendResponse("200", "OK", myConn); H.SendResponse("200", "OK", myConn);
@ -247,7 +247,7 @@ namespace Mist {
host.resize(host.find(':')); host.resize(host.find(':'));
} }
H.Clean(); H.Clean();
H.SetHeader("Server", "mistserver/" PACKAGE_VERSION); H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
H.setCORSHeaders(); H.setCORSHeaders();
if (rURL.substr(0, 6) != "/json_"){ if (rURL.substr(0, 6) != "/json_"){
H.SetHeader("Content-Type", "application/javascript"); H.SetHeader("Content-Type", "application/javascript");
@ -267,7 +267,9 @@ namespace Mist {
configLock.post(); configLock.post();
//Stream metadata not found - attempt to start it //Stream metadata not found - attempt to start it
if (Util::startInput(streamName)){ if (Util::startInput(streamName)){
streamIndex.init(streamName, DEFAULT_META_PAGE_SIZE); char pageId[NAME_BUFFER_SIZE];
snprintf(pageId, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, streamName.c_str());
streamIndex.init(pageId, DEFAULT_META_PAGE_SIZE);
if (streamIndex.mapped){ if (streamIndex.mapped){
metaLock = true; metaLock = true;
metaLocker.wait(); metaLocker.wait();