fixed compiler warnings and wrong for i loops

This commit is contained in:
wouter spruit 2015-02-12 13:33:35 +01:00 committed by Thulinma
parent aa6e07c2bd
commit 2c17b7a1e7

View file

@ -138,7 +138,7 @@ namespace Mist {
///\todo make sure the header is ffmpeg compatible ///\todo make sure the header is ffmpeg compatible
if (myMeta.tracks[tid].codec == "theora"){ if (myMeta.tracks[tid].codec == "theora"){
// INFO_MSG("theora"); // INFO_MSG("theora");
for (int i = 0; i < myPage.getAllSegments().size(); i++){ for (unsigned int i = 0; i < myPage.getAllSegments().size(); i++){
unsigned long len = myPage.getSegmentLen(i); unsigned long len = myPage.getSegmentLen(i);
INFO_MSG("Length for segment %d: %lu", i, len); INFO_MSG("Length for segment %d: %lu", i, len);
theora::header tmpHead((char*)myPage.getSegment(i),len); theora::header tmpHead((char*)myPage.getSegment(i),len);
@ -168,7 +168,7 @@ namespace Mist {
} }
if (myMeta.tracks[tid].codec == "vorbis"){ if (myMeta.tracks[tid].codec == "vorbis"){
for (int i = 0; i < myPage.getAllSegments().size(); i++){ for (unsigned int i = 0; i < myPage.getAllSegments().size(); i++){
unsigned long len = myPage.getSegmentLen(i); unsigned long len = myPage.getSegmentLen(i);
vorbis::header tmpHead((char*)myPage.getSegment(i), len); vorbis::header tmpHead((char*)myPage.getSegment(i), len);
if (!tmpHead.isHeader()){ if (!tmpHead.isHeader()){
@ -182,12 +182,12 @@ namespace Mist {
//we have the first header stored in contBuffer //we have the first header stored in contBuffer
myMeta.tracks[tid].init += (char)0x02; myMeta.tracks[tid].init += (char)0x02;
//ID header size //ID header size
for (int i = 0; i < (oggTracks[tid].contBuffer.size() / 255); i++){ for (unsigned int j = 0; j < (oggTracks[tid].contBuffer.size() / 255); j++){
myMeta.tracks[tid].init += (char)0xFF; myMeta.tracks[tid].init += (char)0xFF;
} }
myMeta.tracks[tid].init += (char)(oggTracks[tid].contBuffer.size() % 255); myMeta.tracks[tid].init += (char)(oggTracks[tid].contBuffer.size() % 255);
//Comment header size //Comment header size
for (int i = 0; i < (len / 255); i++){ for (unsigned int j = 0; j < (len / 255); j++){
myMeta.tracks[tid].init += (char)0xFF; myMeta.tracks[tid].init += (char)0xFF;
} }
myMeta.tracks[tid].init += (char)(len % 255); myMeta.tracks[tid].init += (char)(len % 255);
@ -410,9 +410,6 @@ namespace Mist {
} }
if (!loc){ if (!loc){
INFO_MSG("Unable to find a page boundary starting @ %llu, track %u", tmpPos.bytepos, *it); INFO_MSG("Unable to find a page boundary starting @ %llu, track %u", tmpPos.bytepos, *it);
for (int i = 0; i < 300; i++){
fprintf(stderr, "%0.2X ", buffer[i]);
}
continue; continue;
} }
tmpPos.segmentNo = backChrs - (loc - buffer); tmpPos.segmentNo = backChrs - (loc - buffer);