Re: Getting an AudioDeviceID from device unique identifier (UID)
Re: Getting an AudioDeviceID from device unique identifier (UID)
- Subject: Re: Getting an AudioDeviceID from device unique identifier (UID)
- From: "Sean McBride" <email@hidden>
- Date: Wed, 23 Apr 2003 14:49:38 -0400
- Organization: Matrox Electronic Systems Ltd.
Jeff Moore (email@hidden) wrote on Wed, 23 Apr 2003 11:18:31 -0700:
>
How could AudioHardwareGetProperty() return an error? You passed an
>
address, just not an address that pointed to a valid CFStringRef.
But it would have interpreted what I passed as a valid CFStringRef.
Assuming it didn't crash trying to access God knows what, it should seen
that there was no device with such a uid. Consider this valid code:
AudioDeviceID myDevice = 0xDEADBEEF;
CFStringRef theUID = CFSTR("aoeuaoeua:0");
AudioValueTranslation trans;
trans.mInputData = &theUID;
trans.mInputDataSize = sizeof (CFStringRef);
trans.mOutputData = &myDevice;
trans.mOutputDataSize = sizeof (AudioDeviceID);
UInt32 size = sizeof (AudioValueTranslation);
OSStatus err = 0xCAFE;
err = AudioHardwareGetProperty (kAudioHardwarePropertyDeviceForUID,
&size, &trans);
The result:
err = 0
myDevice = 0xDEADBEEF
Seems to me I should get better than that.
>
I imagine that what you were doing was corrupting your heap, thus
>
setting up the conditions for a very hard to track down random crash
>
bug.
Agreed.
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Mac Software Designer +1-514-822-6000
Matrox Electronic Systems Ltd. Montrial, Quibec, Canada
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.