earliest implementation of sync
does not loop correctly
This commit is contained in:
parent
7a7a871198
commit
394c6c35aa
6 changed files with 70 additions and 4 deletions
|
|
@ -283,6 +283,17 @@ ssize_t DivFilePlayer::getPos() {
|
|||
|
||||
ssize_t DivFilePlayer::setPos(ssize_t newPos, unsigned int offset) {
|
||||
playPos=newPos;
|
||||
rateAccum=0;
|
||||
wantBlock=playPos;
|
||||
return playPos;
|
||||
}
|
||||
|
||||
ssize_t DivFilePlayer::setPosSeconds(ssize_t seconds, unsigned int micros, unsigned int offset) {
|
||||
if (sf==NULL) return 0;
|
||||
double microsD=(double)si.samplerate*((double)micros/1000000.0);
|
||||
playPos=seconds*si.samplerate+(int)microsD;
|
||||
rateAccum=0;
|
||||
wantBlock=playPos;
|
||||
return playPos;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue