Input thread now signals when it has stopped and is about to return, in case the input thread returns before the BufferChain dealloc function would be waiting for it to terminate. Somehow, even though the Semaphore is being signaled at this point, the BufferChain still ends up waiting the default of 2.5 seconds for the signal that apparently never comes, delaying file stoppage. This prevents the wait action entirely. Must have been some sort of race condition. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
52 lines
940 B
Objective-C
52 lines
940 B
Objective-C
//
|
|
// InputNode.h
|
|
// Cog
|
|
//
|
|
// Created by Vincent Spader on 8/2/05.
|
|
// Copyright 2005 Vincent Spader. All rights reserved.
|
|
//
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
#import <AudioToolbox/AudioToolbox.h>
|
|
#import <AudioUnit/AudioUnit.h>
|
|
#import <CoreAudio/AudioHardware.h>
|
|
|
|
#import "AudioDecoder.h"
|
|
#import "Node.h"
|
|
#import "Plugin.h"
|
|
|
|
#define INPUT_NODE_SEEK
|
|
|
|
@interface InputNode : Node {
|
|
id<CogDecoder> decoder;
|
|
|
|
int bytesPerSample;
|
|
int bytesPerFrame;
|
|
BOOL floatingPoint;
|
|
BOOL swapEndian;
|
|
|
|
BOOL shouldSeek;
|
|
long seekFrame;
|
|
|
|
BOOL observersAdded;
|
|
|
|
Semaphore *exitAtTheEndOfTheStream;
|
|
}
|
|
@property(readonly) Semaphore *exitAtTheEndOfTheStream;
|
|
@property(readonly) BOOL threadExited;
|
|
|
|
- (BOOL)openWithSource:(id<CogSource>)source;
|
|
- (BOOL)openWithDecoder:(id<CogDecoder>)d;
|
|
|
|
- (void)process;
|
|
- (NSDictionary *)properties;
|
|
- (void)seek:(long)frame;
|
|
|
|
- (void)registerObservers;
|
|
|
|
- (BOOL)setTrack:(NSURL *)track;
|
|
|
|
- (id<CogDecoder>)decoder;
|
|
|
|
@end
|