• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting an AudioDeviceID from device unique identifier (UID)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Getting an AudioDeviceID from device unique identifier (UID) (From: Jeff Moore <email@hidden>)

  • Prev by Date: Re: Getting an AudioDeviceID from device unique identifier (UID)
  • Next by Date: Re: Getting an AudioDeviceID from device unique identifier (UID)
  • Previous by thread: Re: Getting an AudioDeviceID from device unique identifier (UID)
  • Next by thread: Re: Getting an AudioDeviceID from device unique identifier (UID)
  • Index(es):
    • Date
    • Thread