diff --git a/src/input/input_mp4.cpp b/src/input/input_mp4.cpp index 49f89bdf..77baa0db 100644 --- a/src/input/input_mp4.cpp +++ b/src/input/input_mp4.cpp @@ -280,7 +280,6 @@ namespace Mist { return true; } trackNo = 0; - std::set BPosSet; //Create header file from MP4 data while(!feof(inFile)){ std::string boxType = MP4::readBoxType(inFile); @@ -523,11 +522,7 @@ namespace Mist { }else{ BsetPart.timeOffset = 0; } - //set size, that's easy - BsetPart.size = stszBox.getEntrySize(sampleIndex); - //trackid - BsetPart.trackID=trackNo; - BPosSet.insert(BsetPart); + myMeta.update(BsetPart.time, BsetPart.timeOffset, trackNo, stszBox.getEntrySize(sampleIndex), BsetPart.bpos, BsetPart.keyframe); }//while over stsc if (vidTrack){ //something wrong with the time formula, but the answer is right for some reason @@ -559,25 +554,6 @@ namespace Mist { //for all in bpos set, find its data clearerr(inFile); - for (std::set::iterator it = BPosSet.begin(); it != BPosSet.end(); it++){ - if (!fseeko(inFile,it->bpos,SEEK_SET)){ - if (it->size > malSize){ - data = (char*)realloc(data, it->size); - malSize = it->size; - } - int tmp = fread(data, it->size, 1, inFile); - if (tmp == 1){ - //add data - myMeta.update(it->time, it->timeOffset, it->trackID, it->size, it->bpos, it->keyframe); - }else{ - INFO_MSG("fread did not return 1, bpos: %llu size: %llu keyframe: %d error: %s", it->bpos, it->size, it->keyframe, strerror(errno)); - return false; - } - }else{ - INFO_MSG("fseek failed!"); - return false; - } - }//rof bpos set //outputting dtsh file std::ofstream oFile(std::string(config->getString("input") + ".dtsh").c_str()); oFile << myMeta.toJSON().toNetPacked();