Removed compiled warnings etc from ogg optimizes.

This commit is contained in:
Thulinma 2014-01-13 16:00:09 +01:00
parent d8b7a3ea1c
commit 211eb38613
4 changed files with 4 additions and 51 deletions

View file

@ -17,7 +17,6 @@ namespace Converters{
DTSC::File DTSCFile(conf.getString("filename"));
srand (Util::getMS());//randomising with milliseconds from boot
std::vector<unsigned int> curSegTable;
char* curNewPayload;
OGG::converter oggMeta;
//Creating ID headers for theora and vorbis
DTSC::readOnlyMeta fileMeta = DTSCFile.getMeta();
@ -29,20 +28,12 @@ namespace Converters{
//create DTSC in OGG pages
DTSCFile.parseNext();
std::map< long long int, std::vector<JSON::Value> > DTSCBuffer;
long long unsigned int prevGran;
long long int currID;
long long unsigned int currGran;
OGG::Page curOggPage;
while(DTSCFile.getJSON()){
currID = DTSCFile.getJSON()["trackid"].asInt();
currGran = DTSCFile.getJSON()["granule"].asInt();
if (DTSCBuffer.count(currID) && !DTSCBuffer[currID].empty()){
prevGran = DTSCBuffer[currID][0]["granule"].asInt();
}else{
prevGran = 0;
}
if (!DTSCBuffer[currID].empty()){
std::cout << oggMeta.readDTSCVector(DTSCBuffer[currID]);
DTSCBuffer[currID].clear();

View file

@ -92,7 +92,7 @@ namespace OGG{
for (unsigned int i = 0; i < DTSCVec.size(); i++){
OGG::Page tempPage;
tempPage.setSegmentTable(curSegTable);
if (DTSCVec[i]["data"].asString().size() >= (255-tempPage.getPageSegments())*255){//if segment is too big
if (DTSCVec[i]["data"].asString().size() >= (255-tempPage.getPageSegments())*255u){//if segment is too big
//Put page in Buffer and start next page
if (!curSegTable.empty()){
//output page
@ -112,13 +112,12 @@ namespace OGG{
dataBuffer = "";
}
std::string remainingData = DTSCVec[i]["data"].asString();
bool firstLoop;
typeFlag = 0;
while (remainingData.size() > 255*255){
//output part of the segment
//granule -1
curSegTable.clear();
curSegTable.push_back(255*255);///\TODO optimise this
curSegTable.push_back(255*255);
retVal.clear();
retVal.setVersion();
retVal.setHeaderType(typeFlag);//normal Page