Re: Getting an AudioStreamBasicDescription from a stream, not a file
Re: Getting an AudioStreamBasicDescription from a stream, not a file
- Subject: Re: Getting an AudioStreamBasicDescription from a stream, not a file
- From: "Kevin Dixon" <email@hidden>
- Date: Wed, 2 Apr 2008 16:37:16 -0400 (EDT)
- Importance: Normal
> I get the compile-time error "invalid lvalue in assignment".
This line is the one that's giving you grief.
> &pAqData->mDataFormat = (AudioStreamBasicDescription*) property;
The "&" operator gives the memory address of a given variable
The "*" operator dereferences a pointer.
The "->" operator both dereferences a pointer and access the member
requested.
E.g. pAqData->mDataFormat is equivelent to (*pAqData).mDataFormat
So...
&pAqData->mDataFormat
means: take the address of pAqData and dereference. Since pAqData is
already a pointer, you are taking a pointer to a pointer, and then trying
to operate on that, which can't be resolved by the compiler.
What you meant was
pAqData->mDataFormat
If mDataFormat is a pointer to an AudioStreamBasicDecription, then you
would do this:
pAqData->mDataFormat = &property;
if its a poitner to void, that would also work.
C/C++ pointers are fun!
Hope that helps
-Kevin
_______________________________________________
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