Playback: Redo seeking to stick with the open file
Some checks are pending
Check if Cog buildable / Build Universal Cog.app (push) Waiting to run
Some checks are pending
Check if Cog buildable / Build Universal Cog.app (push) Waiting to run
Again, this is for the best anyway. Reopening the file repeatedly really was slow, and resulted in deadlocks with rapid fire seeking, especially with the Touch Bar scrubber control. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
parent
b5b752c884
commit
646531f8ae
1 changed files with 15 additions and 5 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 {
|
||||
|
|
Loading…
Reference in a new issue