Small fixes in DTSC lib.
This commit is contained in:
parent
a3bae91486
commit
c1560deaa9
1 changed files with 7 additions and 6 deletions
13
lib/dtsc.cpp
13
lib/dtsc.cpp
|
@ -728,6 +728,7 @@ void DTSC::File::seekNext(){
|
||||||
jsonbuffer.null();
|
jsonbuffer.null();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
fseek(F,currentPositions.begin()->seekPos, SEEK_SET);
|
||||||
seek_time(currentPositions.begin()->seekTime + 1, currentPositions.begin()->trackID);
|
seek_time(currentPositions.begin()->seekTime + 1, currentPositions.begin()->trackID);
|
||||||
fseek(F,currentPositions.begin()->seekPos, SEEK_SET);
|
fseek(F,currentPositions.begin()->seekPos, SEEK_SET);
|
||||||
currentPositions.erase(currentPositions.begin());
|
currentPositions.erase(currentPositions.begin());
|
||||||
|
@ -805,14 +806,16 @@ JSON::Value & DTSC::File::getJSON(){
|
||||||
bool DTSC::File::seek_time(int ms, int trackNo){
|
bool DTSC::File::seek_time(int ms, int trackNo){
|
||||||
seekPos tmpPos;
|
seekPos tmpPos;
|
||||||
tmpPos.trackID = trackNo;
|
tmpPos.trackID = trackNo;
|
||||||
tmpPos.seekTime = metadata["tracks"][trackMapping[trackNo]]["keytime"][0u].asInt();
|
tmpPos.seekTime = jsonbuffer["time"].asInt();
|
||||||
tmpPos.seekPos = metadata["tracks"][trackMapping[trackNo]]["keybpos"][0u].asInt();
|
tmpPos.seekPos = getBytePos();
|
||||||
for (int i = 0; i < metadata["tracks"][trackMapping[trackNo]]["keynum"].size(); i++){
|
for (int i = 0; i < metadata["tracks"][trackMapping[trackNo]]["keynum"].size(); i++){
|
||||||
if (metadata["tracks"][trackMapping[trackNo]]["keytime"][i].asInt() > ms){
|
if (metadata["tracks"][trackMapping[trackNo]]["keytime"][i].asInt() > ms){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tmpPos.seekTime = metadata["tracks"][trackMapping[trackNo]]["keytime"][i].asInt();
|
if (metadata["tracks"][trackMapping[trackNo]]["keytime"][i].asInt() > jsonbuffer["time"].asInt()){
|
||||||
tmpPos.seekPos = metadata["tracks"][trackMapping[trackNo]]["keybpos"][i].asInt();
|
tmpPos.seekTime = metadata["tracks"][trackMapping[trackNo]]["keytime"][i].asInt();
|
||||||
|
tmpPos.seekPos = metadata["tracks"][trackMapping[trackNo]]["keybpos"][i].asInt();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
bool foundPacket = false;
|
bool foundPacket = false;
|
||||||
while ( !foundPacket){
|
while ( !foundPacket){
|
||||||
|
@ -891,8 +894,6 @@ bool DTSC::File::atKeyframe(){
|
||||||
void DTSC::File::selectTracks(std::set<int> & tracks){
|
void DTSC::File::selectTracks(std::set<int> & tracks){
|
||||||
currentPositions.clear();
|
currentPositions.clear();
|
||||||
selectedTracks = tracks;
|
selectedTracks = tracks;
|
||||||
for (std::set<int>::iterator it = tracks.begin(); it != tracks.end(); it++){
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Close the file if open
|
/// Close the file if open
|
||||||
|
|
Loading…
Add table
Reference in a new issue