diff --git a/src/io.cpp b/src/io.cpp index ec35814d..c7471608 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -303,16 +303,16 @@ namespace Mist { //8 byte timestamp memcpy(myPage.mapped + curOffset + 12, pack.getData() + 12, 8); //The mapped track id - ((int *)(curPage[tid].mapped + curOffset + 8))[0] = htonl(mapTid); + ((int *)(myPage.mapped + curOffset + 8))[0] = htonl(mapTid); int size = Bit::btohl(pack.getData() + 4); if (encrypt){ //Alter size to reflect the addition of the ivec field ( + 19 ) size += 19; } //Write the size - Bit::htobl(curPage[tid].mapped + curOffset + 4, size); + Bit::htobl(myPage.mapped + curOffset + 4, size); //write the 'DTP2' bytes to conclude the packet and allow for reading it - memcpy(curPage[tid].mapped + curOffset, pack.getData(), 4); + memcpy(myPage.mapped + curOffset, pack.getData(), 4); if (myMeta.live){ @@ -391,6 +391,12 @@ namespace Mist { curPageNum.erase(tid); } + ///Buffers a live packet to a page. + /// + ///Handles both buffering and creation of new pages + /// + ///Initiates/continues negotiation with the buffer as well + ///\param packet The packet to buffer void InOutBase::bufferLivePacket(JSON::Value & packet) { DTSC::Packet realPacket; realPacket.genericFill(packet["time"].asInt(), packet["offset"].asInt(), packet["trackid"].asInt(), packet["data"].asStringRef().c_str(), packet["data"].asStringRef().size(), packet["bpos"].asInt(), packet["keyframe"].asInt()); diff --git a/src/output/output.cpp b/src/output/output.cpp index 0ac692ff..f267d2da 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -131,7 +131,7 @@ namespace Mist { metaPages.clear(); metaPages[0].init(pageId, DEFAULT_META_PAGE_SIZE); if (!metaPages[0].mapped){ - DEBUG_MSG(DLVL_FAIL, "Could not connect to server for %s\n", streamName.c_str()); + FAIL_MSG("Could not connect to server for %s", streamName.c_str()); onFail(); return; } diff --git a/src/output/output_hds.cpp b/src/output/output_hds.cpp index b35ef718..94a4274c 100644 --- a/src/output/output_hds.cpp +++ b/src/output/output_hds.cpp @@ -214,7 +214,7 @@ namespace Mist { temp = H.url.find("Seg") + 3; temp = H.url.find("Frag") + 4; fragNum = atoi(H.url.substr(temp).c_str()) - 1; - DEBUG_MSG(DLVL_MEDIUM, "Video track %d, fragment %d\n", tid, fragNum); + DEBUG_MSG(DLVL_MEDIUM, "Video track %d, fragment %d", tid, fragNum); if (!audioTrack){getTracks();} unsigned int mstime = 0; unsigned int mslen = 0; diff --git a/src/output/output_rtmp.cpp b/src/output/output_rtmp.cpp index 42e6f668..da84333c 100644 --- a/src/output/output_rtmp.cpp +++ b/src/output/output_rtmp.cpp @@ -842,7 +842,7 @@ namespace Mist { case 18: {//meta data static std::map pushMeta; if (!isInitialized) { - DEBUG_MSG(DLVL_MEDIUM, "Received useless media data\n"); + MEDIUM_MSG("Received useless media data"); myConn.close(); break; }