Added some error messages that should hopefully fix some initial stuttering issues.
parent
2a0b588f4d
commit
77c7819dd6
|
@ -22,6 +22,8 @@
|
|||
id nextStreamUserInfo;
|
||||
|
||||
id delegate;
|
||||
|
||||
BOOL outputLaunched;
|
||||
}
|
||||
|
||||
- (id)init;
|
||||
|
@ -65,6 +67,7 @@
|
|||
- (void)endOfInputReached:(BufferChain *)sender;
|
||||
- (void)setShouldContinue:(BOOL)s;
|
||||
- (BufferChain *)bufferChain;
|
||||
- (void)launchOutputThread;
|
||||
- (void)endOfInputPlayed;
|
||||
- (void)sendDelegateMethod:(SEL)selector withObject:(id)obj waitUntilDone:(BOOL)wait;
|
||||
@end
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
{
|
||||
output = NULL;
|
||||
bufferChain = NULL;
|
||||
outputLaunched = NO;
|
||||
|
||||
chainQueue = [[NSMutableArray alloc] init];
|
||||
}
|
||||
|
@ -91,9 +92,9 @@
|
|||
[bufferChain setUserInfo:userInfo];
|
||||
|
||||
[self setShouldContinue:YES];
|
||||
DBLog(@"DETACHING THREADS");
|
||||
|
||||
[output launchThread];
|
||||
outputLaunched = NO;
|
||||
NSLog(@"Launching input thread!");
|
||||
[bufferChain launchThreads];
|
||||
|
||||
[self setPlaybackStatus:kCogStatusPlaying];
|
||||
|
@ -165,6 +166,13 @@
|
|||
return [output amountPlayed];
|
||||
}
|
||||
|
||||
- (void)launchOutputThread
|
||||
{
|
||||
if (outputLaunched == NO) {
|
||||
NSLog(@"Launching output thread!");
|
||||
[output launchThread];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -40,6 +40,8 @@
|
|||
|
||||
- (void)setShouldContinue:(BOOL)s;
|
||||
|
||||
- (void)initialBufferFilled;
|
||||
|
||||
- (void)endOfInputReached;
|
||||
|
||||
|
||||
|
|
|
@ -107,6 +107,11 @@
|
|||
[controller endOfInputReached:self];
|
||||
}
|
||||
|
||||
- (void)initialBufferFilled
|
||||
{
|
||||
[controller launchOutputThread];
|
||||
}
|
||||
|
||||
|
||||
- (id)finalNode
|
||||
{
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
BOOL shouldContinue;
|
||||
BOOL endOfStream; //All data is now in buffer
|
||||
BOOL initialBufferFilled;
|
||||
}
|
||||
- (id)initWithController:(id)c previous:(id)p;
|
||||
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
readLock = [[NSLock alloc] init];
|
||||
writeLock = [[NSLock alloc] init];
|
||||
|
||||
initialBufferFilled = NO;
|
||||
|
||||
controller = c;
|
||||
previousNode = p;
|
||||
endOfStream = NO;
|
||||
|
@ -43,6 +45,11 @@
|
|||
if (availOutput == 0)
|
||||
{
|
||||
[writeLock unlock];
|
||||
if (initialBufferFilled == NO) {
|
||||
initialBufferFilled = YES;\
|
||||
if ([controller respondsToSelector:@selector(initialBufferFilled)])
|
||||
[controller performSelector:@selector(initialBufferFilled)];
|
||||
}
|
||||
[semaphore wait];
|
||||
[writeLock lock];
|
||||
}
|
||||
|
@ -104,7 +111,13 @@
|
|||
//If it is the outputNode, [soundController newInputChain];
|
||||
//else
|
||||
endOfStream = YES;
|
||||
}
|
||||
}
|
||||
if (availInput <= 0) {
|
||||
NSLog(@"BUFFER RAN DRY!");
|
||||
}
|
||||
else if (availInput < amount) {
|
||||
NSLog(@"BUFFER IN DANGER");
|
||||
}
|
||||
|
||||
amountToCopy = availInput;
|
||||
if (amountToCopy > amount)
|
||||
|
|
Loading…
Reference in New Issue