Fixed bugs in dtsc and theora libs.
This commit is contained in:
parent
6675b647b8
commit
6cf42561a6
3 changed files with 8 additions and 7 deletions
|
@ -811,6 +811,7 @@ void DTSC::File::seekNext(){
|
|||
if ((*it)["time"].asInt() > jsonbuffer["time"].asInt()){
|
||||
tmpPos.seekTime = (*it)["time"].asInt();
|
||||
tmpPos.seekPos = (*it)["bpos"].asInt();
|
||||
tmpPos.trackID = jsonbuffer["trackid"].asInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -826,7 +827,7 @@ void DTSC::File::seekNext(){
|
|||
if (insert){
|
||||
currentPositions.insert(tmpPos);
|
||||
}else{
|
||||
seek_time(jsonbuffer["time"].asInt() + 1, jsonbuffer["trackid"].asInt());
|
||||
seek_time(jsonbuffer["time"].asInt() + 1, jsonbuffer["trackid"].asInt(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -913,10 +914,10 @@ JSON::Value & DTSC::File::getTrackById(int trackNo){
|
|||
return empty;
|
||||
}
|
||||
|
||||
bool DTSC::File::seek_time(int ms, int trackNo){
|
||||
bool DTSC::File::seek_time(int ms, int trackNo, bool forceSeek){
|
||||
seekPos tmpPos;
|
||||
tmpPos.trackID = trackNo;
|
||||
if (jsonbuffer && ms > jsonbuffer["time"].asInt() && trackNo >= jsonbuffer["trackid"].asInt()){
|
||||
if (!forceSeek && jsonbuffer && ms > jsonbuffer["time"].asInt() && trackNo >= jsonbuffer["trackid"].asInt()){
|
||||
tmpPos.seekTime = jsonbuffer["time"].asInt();
|
||||
tmpPos.seekPos = getBytePos();
|
||||
}else{
|
||||
|
|
|
@ -110,7 +110,7 @@ namespace DTSC {
|
|||
JSON::Value & getJSON();
|
||||
JSON::Value & getTrackById(int trackNo);
|
||||
bool seek_time(int seconds);
|
||||
bool seek_time(int seconds, int trackNo);
|
||||
bool seek_time(int seconds, int trackNo, bool forceSeek = false);
|
||||
bool seek_bpos(int bpos);
|
||||
void writePacket(std::string & newPacket);
|
||||
void writePacket(JSON::Value & newPacket);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include<theora.h>
|
||||
#include "theora.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <arpa/inet.h>
|
||||
|
|
Loading…
Add table
Reference in a new issue