diff --git a/src/connectors/conn_http_progressive_ogg.cpp b/src/connectors/conn_http_progressive_ogg.cpp index c42229eb..fa5d4f51 100644 --- a/src/connectors/conn_http_progressive_ogg.cpp +++ b/src/connectors/conn_http_progressive_ogg.cpp @@ -160,7 +160,7 @@ namespace Connector_HTTP { } //parse DTSC to Ogg here long long unsigned int temp = Strm.getPacket()["trackid"].asInt(); - if(prevGran[temp] != Strm.getPacket()["granule"].asInt() && DTSCBuffer[temp].size() != 0){ + if((prevGran[temp] != Strm.getPacket()["granule"].asInt() || prevGran[temp] == -1) && DTSCBuffer[temp].size() != 0){ curOggPage.readDTSCVector(DTSCBuffer[temp], oggMeta.DTSCID2OGGSerial[temp], oggMeta.DTSCID2seqNum[temp]); conn.SendNow((char*)curOggPage.getPage(), curOggPage.getPageSize()); DTSCBuffer[temp].clear(); @@ -168,11 +168,10 @@ namespace Connector_HTTP { if (Strm.lastType() == DTSC::PAUSEMARK){ conn.close(); } - if (Strm.lastType() == DTSC::AUDIO || Strm.lastType() == DTSC::VIDEO){ - //long long unsigned int prevID = Strm.getPacket()["trackid"].asInt(); + //if (Strm.lastType() == DTSC::AUDIO || Strm.lastType() == DTSC::VIDEO){ DTSCBuffer[temp].push_back(Strm.getPacket()); prevGran[temp] = Strm.getPacket()["granule"].asInt(); - } + //} } }else{ Util::sleep(1); diff --git a/src/converters/dtsc2ogg.cpp b/src/converters/dtsc2ogg.cpp index e60a9e93..39ec78b7 100644 --- a/src/converters/dtsc2ogg.cpp +++ b/src/converters/dtsc2ogg.cpp @@ -69,7 +69,7 @@ namespace Converters{ std::string pageBuffer; while(DTSCFile.getJSON()){ - if(DTSCFile.getJSON()["trackid"].asInt()!=prevID || DTSCFile.getJSON()["granule"].asInt()!=prevGran){ + if(DTSCFile.getJSON()["trackid"].asInt()!=prevID || DTSCFile.getJSON()["granule"].asInt()!=prevGran || DTSCFile.getJSON()["granule"].asInt() == -1){ curOggPage.clear(); curOggPage.setVersion(); if (OggCont){ @@ -82,7 +82,13 @@ namespace Converters{ curOggPage.setGranulePosition(prevGran); curOggPage.setBitstreamSerialNumber(DTSCID2OGGSerial[prevID]); curOggPage.setPageSequenceNumber(DTSCID2seqNum[prevID]++); - curOggPage.setSegmentTable(curSegTable); + if(!curOggPage.setSegmentTable(curSegTable)){ + std::cerr << "Troubling segTable:"; + for (unsigned int i = 0; i