From 435633180c6ca56e51ab17fd75fb8ae80b90c48d Mon Sep 17 00:00:00 2001 From: Thulinma Date: Thu, 25 Sep 2014 10:57:41 +0200 Subject: [PATCH] Made HLS and HSS be non-realtime, improved HLS debug messages. --- src/output/output_hls.cpp | 24 +++++++++--------------- src/output/output_hss.cpp | 1 + 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/output/output_hls.cpp b/src/output/output_hls.cpp index ed750d1e..c60f56d1 100644 --- a/src/output/output_hls.cpp +++ b/src/output/output_hls.cpp @@ -33,9 +33,7 @@ namespace Mist { result << "/index.m3u8\r\n"; } } -#if DEBUG >= 8 - std::cerr << "Sending this index:" << std::endl << result.str() << std::endl; -#endif + DEBUG_MSG(DLVL_HIGH, "Sending this index: %s", result.str().c_str()); return result.str(); } @@ -88,7 +86,9 @@ namespace Mist { OutHLS::OutHLS(Socket::Connection & conn) : Output(conn) { haveAvcc = false; + realTime = 0; myConn.setHost(config->getString("ip")); + myConn.setBlocking(true); streamName = config->getString("streamname"); } @@ -186,27 +186,25 @@ namespace Mist { } - void OutHLS::sendNext(){ - bool first = true; + void OutHLS::sendNext(){ + bool first = true; char * ContCounter = 0; char * dataPointer = 0; unsigned int dataLen = 0; currentPacket.getString("data", dataPointer, dataLen); //data if (currentPacket.getTime() >= until){ - DEBUG_MSG(DLVL_DEVEL, "(%d) Done sending fragment", getpid() ); stop(); wantRequest = true; + parseData = false; HTTP_S.Chunkify("", 0, myConn); HTTP_S.Clean(); return; } - - - std::string bs; + std::string bs; //prepare bufferstring - if (myMeta.tracks[currentPacket.getTrackId()].type == "video"){ + if (myMeta.tracks[currentPacket.getTrackId()].type == "video"){ bs = TS::Packet::getPESVideoLeadIn(0ul, currentPacket.getTime() * 90); fillPacket(first, bs.data(), bs.size(), VideoCounter); @@ -250,9 +248,6 @@ namespace Mist { fillPacket(first, 0, 0, AudioCounter); } } - - - } int OutHLS::canSeekms(unsigned int ms){ @@ -276,8 +271,7 @@ namespace Mist { void OutHLS::onRequest(){ while (HTTP_R.Read(myConn)){ - DEBUG_MSG(DLVL_DEVEL, "Received request: %s", HTTP_R.getUrl().c_str()); - + DEBUG_MSG(DLVL_MEDIUM, "Received request: %s", HTTP_R.getUrl().c_str()); if (HTTP_R.url == "/crossdomain.xml"){ HTTP_S.Clean(); HTTP_S.SetHeader("Content-Type", "text/xml"); diff --git a/src/output/output_hss.cpp b/src/output/output_hss.cpp index 39066742..687103c6 100644 --- a/src/output/output_hss.cpp +++ b/src/output/output_hss.cpp @@ -45,6 +45,7 @@ std::string toUTF16(std::string original) { namespace Mist { OutHSS::OutHSS(Socket::Connection & conn) : Output(conn) { + realTime = 0; myConn.setHost(config->getString("ip")); streamName = config->getString("streamname"); }