I think I weaseled out or my thread problem.
I think I weaseled out or my thread problem.
- Subject: I think I weaseled out or my thread problem.
- From: John Draper <email@hidden>
- Date: Wed, 12 Apr 2006 23:18:45 -0700
Hi,
I'm not "Out of the woods" just yet. First, here is what I did.
I confirmed my code which puts a chunk of audio into a data Queue,
is running from within the RTP Listen thread.
So, when Changed my code to look like this...
// This function runs from within a thread other then the main loop
- (void)incomingPacket:(char *)theData
ofLength:(int)len
{
// Construct a data object from pointer and length
NSData *data = [NSData dataWithBytes:theData
length:len];
// Force following method to execute in main loop
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[self performSelectorOnMainThread:@selector(procFromMainLoop:)
withObject:data waitUntilDone:NO];
[pool release];
}
// this is the function that can never run from within a thread.
- (void)procFromMainLoop:(NSData *)myData
{
[mAudioTransporter processIncomingData:myData];
}
And program runs just fine now, except I think there it too much of a
time interval between
the "incomingPacket" method and the "procFromMainLoop".
Is there a way to measure this time interval? It has to be much faster
then about 20 ms or my
timing will be off, and the audio will sound fluttery because of the
extra time from the time I
have my audio samples, and the time it gets put into the "play" buffer.
What kind of tools are available for measuring this time. Obviously,
this varies a lot, based on
what's going on in the computer.
John
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden