mamburu: Fixed InputNode's thread not being stopped at all
parent
56848daad6
commit
1b818bcaa7
|
@ -57,7 +57,6 @@
|
|||
output = [[OutputNode alloc] initWithController:self previous:nil];
|
||||
[output setup];
|
||||
[output setVolume: volume];
|
||||
|
||||
@synchronized(chainQueue) {
|
||||
for (id anObject in chainQueue)
|
||||
{
|
||||
|
@ -65,7 +64,6 @@
|
|||
}
|
||||
[chainQueue removeAllObjects];
|
||||
endOfInputReached = NO;
|
||||
|
||||
if (bufferChain)
|
||||
{
|
||||
[bufferChain setShouldContinue:NO];
|
||||
|
@ -73,7 +71,7 @@
|
|||
[bufferChain release];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bufferChain = [[BufferChain alloc] initWithController:self];
|
||||
[self notifyStreamChanged:userInfo];
|
||||
|
||||
|
@ -97,7 +95,7 @@
|
|||
|
||||
bufferChain = [[BufferChain alloc] initWithController:self];
|
||||
}
|
||||
|
||||
|
||||
[bufferChain setUserInfo:userInfo];
|
||||
|
||||
[self setShouldContinue:YES];
|
||||
|
|
|
@ -122,6 +122,10 @@
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
[[inputNode exitAtTheEndOfTheStream] signal];
|
||||
[[inputNode semaphore] signal];
|
||||
[[inputNode exitAtTheEndOfTheStream] wait]; // wait for decoder to be closed (see InputNode's -(void)process )
|
||||
|
||||
[rgInfo release];
|
||||
[userInfo release];
|
||||
[streamURL release];
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
Semaphore *exitAtTheEndOfTheStream;
|
||||
}
|
||||
@property(readonly) Semaphore *exitAtTheEndOfTheStream;
|
||||
|
||||
- (BOOL)openWithSource:(id<CogSource>)source;
|
||||
- (BOOL)openWithDecoder:(id<CogDecoder>) d;
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
#import "Logging.h"
|
||||
|
||||
@implementation InputNode
|
||||
@synthesize exitAtTheEndOfTheStream;
|
||||
|
||||
|
||||
- (id)initWithController:(id)c previous:(id)p {
|
||||
self = [super initWithController:c previous:p];
|
||||
|
@ -174,6 +176,8 @@
|
|||
free(inputBuffer);
|
||||
|
||||
[exitAtTheEndOfTheStream signal];
|
||||
|
||||
DLog("Input node thread stopping");
|
||||
}
|
||||
|
||||
- (void)seek:(long)frame
|
||||
|
@ -203,16 +207,13 @@
|
|||
- (void)dealloc
|
||||
{
|
||||
DLog(@"Input Node dealloc");
|
||||
[exitAtTheEndOfTheStream signal];
|
||||
[exitAtTheEndOfTheStream wait]; // wait for decoder to be closed (see -(void)process )
|
||||
[exitAtTheEndOfTheStream release];
|
||||
|
||||
[decoder removeObserver:self forKeyPath:@"properties"];
|
||||
[decoder removeObserver:self forKeyPath:@"metadata"];
|
||||
|
||||
[decoder release];
|
||||
|
||||
[super dealloc];
|
||||
|
||||
[exitAtTheEndOfTheStream release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSDictionary *) properties
|
||||
|
|
Loading…
Reference in New Issue