Merge branch 'development' into LTS_development

# Conflicts:
#	src/io.cpp
This commit is contained in:
Thulinma 2015-10-08 13:58:43 +02:00
commit c390035523
4 changed files with 12 additions and 6 deletions

View file

@ -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());

View file

@ -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;
}

View file

@ -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;

View file

@ -842,7 +842,7 @@ namespace Mist {
case 18: {//meta data
static std::map<unsigned int, AMF::Object> pushMeta;
if (!isInitialized) {
DEBUG_MSG(DLVL_MEDIUM, "Received useless media data\n");
MEDIUM_MSG("Received useless media data");
myConn.close();
break;
}