Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AEDSPUtilities: added AEDSPClearBufferList & AEDSPClearAudioBuffer #6

Closed

Conversation

32Beat
Copy link

@32Beat 32Beat commented Apr 16, 2016

I would like to see these or something similar added to the AEDSPUtilities, thx

@michaeltyson
Copy link
Collaborator

Hmm, I dunno about the duplication of functionality that's in AEAudioBufferListUtilities. Feels a bit messy...

@32Beat
Copy link
Author

32Beat commented Apr 16, 2016

Well, if you have the functionality, why aren't you using it?

But this specific choice is meant to indicate that we're clearing float buffers since vDSP is specifically targeting floating point vectors, and hence we don't need the streamformat.

I'm okay stuffing it elsewhere, as long as we also make a choice about what to do with the mDataByteSize field. I eventually decided that the OS uses it as an output indicator: "I manipulated this many bytes", or "this many bytes are now valid". It (clearly) has no relation with the size of the pointer behind data.

Also, do we have a namingconvention perhaps like:
AEDSPBufferListClearFrames and AEDSPAudioBufferClearFrames

@michaeltyson
Copy link
Collaborator

Anywhere in particular you see it not being used where it should be? I'm using it in most places...

@32Beat
Copy link
Author

32Beat commented Apr 23, 2016

c83e19e

There are other places where this loop occurs one way or another. In my experience, generally when you write the same functionality (particularly some kind of loop) more than once, immediately consider a helper function so that you can implement uniform behavior and write it only once. Write it once => means less effort now and particularly in the future, since making mistakes occurs in one place only. (I presume the advantages in debugging & maintenance are obvious.)

NB: I still think the above commit did not solve the real issue of whether or not to set the mDataByteSize field when clearing the buffer.

@michaeltyson
Copy link
Collaborator

I've done a scan through, yep, there are a few places where I didn't use it. Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants