diff --git a/src/io.cpp b/src/io.cpp index c51c1f03..5f1b5779 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -218,7 +218,7 @@ namespace Mist { size_t curOffset = pagesByTrack[tid][curPageNum[tid]].curOffset; //Do nothing when there is not enough free space on the page to add the packet. if (pagesByTrack[tid][curPageNum[tid]].dataSize - curOffset < pack.getDataLen()) { - INFO_MSG("Trying to buffer a packet on page %lu for track %lu~>%lu, but we have a size mismatch", curPageNum[tid], tid, mapTid); + FAIL_MSG("Trying to buffer a packet on page %lu for track %lu~>%lu, but we have a size mismatch. The packet is %lu bytes long, so won't fit at offset %lu on a page of %lu bytes!", curPageNum[tid], tid, mapTid, pack.getDataLen(), curOffset, pagesByTrack[tid][curPageNum[tid]].dataSize); return; } diff --git a/src/output/output_hls.cpp b/src/output/output_hls.cpp index 33ea94d9..cec5ff4c 100644 --- a/src/output/output_hls.cpp +++ b/src/output/output_hls.cpp @@ -175,6 +175,17 @@ namespace Mist { return; } //crossdomain.xml + if (H.method == "OPTIONS"){ + H.Clean(); + H.SetHeader("Content-Type", "application/octet-stream"); + H.SetHeader("Cache-Control", "no-cache"); + H.setCORSHeaders(); + H.SetBody(""); + H.SendResponse("200", "OK", myConn); + H.Clean(); + return; + } + if (H.url.find("hls") == std::string::npos){ myConn.close(); return; diff --git a/src/output/output_hss.cpp b/src/output/output_hss.cpp index aad71b9d..0087cc56 100644 --- a/src/output/output_hss.cpp +++ b/src/output/output_hss.cpp @@ -313,6 +313,7 @@ namespace Mist { H.Clean(); H.SetHeader("Content-Type", "video/mp4"); + H.setCORSHeaders(); H.StartResponse(H, myConn); H.Chunkify(moof_box.asBox(), moof_box.boxedSize(), myConn); int size = htonl(keySize + 8); @@ -505,12 +506,23 @@ namespace Mist { void OutHSS::onHTTP() { + if (H.method == "OPTIONS"){ + H.Clean(); + H.SetHeader("Content-Type", "application/octet-stream"); + H.SetHeader("Cache-Control", "no-cache"); + H.setCORSHeaders(); + H.SetBody(""); + H.SendResponse("200", "OK", myConn); + H.Clean(); + return; + } initialize(); if (H.url.find("Manifest") != std::string::npos) { //Manifest, direct reply H.Clean(); H.SetHeader("Content-Type", "text/xml"); H.SetHeader("Cache-Control", "no-cache"); + H.setCORSHeaders(); /*LTS std::string manifest = smoothIndex(); LTS*/