• 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 AudioStreamBasicDescription from a stream, not a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Getting an AudioStreamBasicDescription from a stream, not a file (From: Chris Adamson <email@hidden>)
 >Re: Getting an AudioStreamBasicDescription from a stream, not a file (From: Jens Alfke <email@hidden>)
 >Re: Getting an AudioStreamBasicDescription from a stream, not a file (From: Chris Adamson <email@hidden>)

  • Prev by Date: Re: Getting an AudioStreamBasicDescription from a stream, not a file
  • Next by Date: Re: HAL user-land audio driver
  • Previous by thread: Re: Getting an AudioStreamBasicDescription from a stream, not a file
  • Next by thread: Re: Getting an AudioStreamBasicDescription from a stream, not a file
  • Index(es):
    • Date
    • Thread