Through a bit of ugliness and interface exposure, the InputNode will now pause the OutputNode while it is making the decoder seek, which prevents cases of the output continuing to run for seconds at a time during a slow seek operation by decoders such as HighlyComplete
parent
761ea97e0e
commit
755147b48a
|
@ -61,4 +61,6 @@
|
|||
|
||||
- (BOOL)isRunning;
|
||||
|
||||
- (id)controller;
|
||||
|
||||
@end
|
||||
|
|
|
@ -207,4 +207,9 @@
|
|||
return NO;
|
||||
}
|
||||
|
||||
- (id)controller
|
||||
{
|
||||
return controller;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
#import "BufferChain.h"
|
||||
#import "Plugin.h"
|
||||
#import "CoreAudioUtils.h"
|
||||
#import "AudioPlayer.h"
|
||||
#import "OutputNode.h"
|
||||
|
||||
|
||||
#import "Logging.h"
|
||||
|
@ -120,8 +122,12 @@
|
|||
{
|
||||
if (shouldSeek == YES)
|
||||
{
|
||||
OutputNode *output = [[controller controller] output];
|
||||
BOOL isPaused = [output isPaused];
|
||||
if ( !isPaused ) [output pause];
|
||||
DLog(@"SEEKING!");
|
||||
[decoder seek:seekFrame];
|
||||
if ( !isPaused ) [output resume];
|
||||
shouldSeek = NO;
|
||||
DLog(@"Seeked! Resetting Buffer");
|
||||
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
unsigned long long amountPlayed;
|
||||
OutputCoreAudio *output;
|
||||
|
||||
BOOL paused;
|
||||
}
|
||||
|
||||
- (double)amountPlayed;
|
||||
|
@ -41,4 +43,6 @@
|
|||
- (void)pause;
|
||||
- (void)resume;
|
||||
|
||||
- (BOOL)isPaused;
|
||||
|
||||
@end
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
- (void)setup
|
||||
{
|
||||
amountPlayed = 0;
|
||||
|
||||
paused = YES;
|
||||
|
||||
output = [[OutputCoreAudio alloc] initWithController:self];
|
||||
|
||||
|
@ -33,16 +35,19 @@
|
|||
|
||||
- (void)process
|
||||
{
|
||||
paused = NO;
|
||||
[output start];
|
||||
}
|
||||
|
||||
- (void)pause
|
||||
{
|
||||
paused = YES;
|
||||
[output pause];
|
||||
}
|
||||
|
||||
- (void)resume
|
||||
{
|
||||
paused = NO;
|
||||
[output resume];
|
||||
}
|
||||
|
||||
|
@ -111,4 +116,9 @@
|
|||
// if (s == NO)
|
||||
// [output stop];
|
||||
}
|
||||
|
||||
- (BOOL)isPaused
|
||||
{
|
||||
return paused;
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue