diff --git a/lib/dtsc.cpp b/lib/dtsc.cpp index 7e0204b6..f1463f10 100644 --- a/lib/dtsc.cpp +++ b/lib/dtsc.cpp @@ -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{ diff --git a/lib/dtsc.h b/lib/dtsc.h index 81675c85..0d112722 100644 --- a/lib/dtsc.h +++ b/lib/dtsc.h @@ -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); diff --git a/lib/theora.cpp b/lib/theora.cpp index 45b12f0a..1e7a23c2 100644 --- a/lib/theora.cpp +++ b/lib/theora.cpp @@ -1,6 +1,6 @@ -#include -#include -#include +#include "theora.h" +#include +#include #include #include