Compare commits
2 commits
d553e51277
...
646531f8ae
Author | SHA1 | Date | |
---|---|---|---|
|
646531f8ae | ||
|
b5b752c884 |
1 changed files with 16 additions and 6 deletions
|
@ -196,18 +196,28 @@
|
|||
}
|
||||
|
||||
- (void)seekToTime:(double)time {
|
||||
[output fadeOutBackground];
|
||||
[output setVolume:volume];
|
||||
|
||||
[output seek:time];
|
||||
[bufferChain seek:time];
|
||||
|
||||
CogStatus status = (CogStatus)currentPlaybackStatus;
|
||||
NSURL *url;
|
||||
BOOL paused = status == CogStatusPaused;
|
||||
id userInfo;
|
||||
NSDictionary *rgi;
|
||||
|
||||
@synchronized(chainQueue) {
|
||||
url = [bufferChain streamURL];
|
||||
userInfo = [bufferChain userInfo];
|
||||
rgi = [bufferChain rgInfo];
|
||||
}
|
||||
|
||||
[self play:url withUserInfo:userInfo withRGInfo:rgi startPaused:(status == CogStatusPaused) andSeekTo:time andResumeInterval:YES];
|
||||
if(paused) {
|
||||
[self setPlaybackStatus:CogStatusPaused waitUntilDone:YES];
|
||||
if(time > 0.0) {
|
||||
[self updatePosition:userInfo];
|
||||
}
|
||||
} else {
|
||||
[output fadeIn];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setVolume:(double)v {
|
||||
|
@ -694,7 +704,7 @@
|
|||
while(atomic_load_explicit(&refCount, memory_order_relaxed) != 0) {
|
||||
[semaphore signal]; // Gotta poke this periodically
|
||||
if(mainThread)
|
||||
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.001]];
|
||||
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.01]];
|
||||
else
|
||||
usleep(500);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue