This previously returned the frame count based on the internal sample
rate of the underlying stream, whereas it should have instead returned
a frame count based on the output sample rate. This commit fixes this.
This commit commit also changes the implementation of
ma_calculate_frame_count_after_src() to use the ma_resampler API which
should make it a bit more robust and easier to maintain.
This change makes a copy of the master volume factor before applying it
so that if another thread changes the volume it won't apply the change
part way through the processing of a period.
These used to represent the size of the entire buffer, with the latency
defined by the the size of this buffer, divided by the period count.
This ended up being confusing because people assumed the buffer size by
itself was enough to define the latency. With this commit, these config
variables have been replaced with ones that take the size of a period
rather than the size of the entire buffer. These are called
periodSizeInFrames and periodSizeInMilliseconds. With this change, the
latency is determined by these settings alone, without needing to take
the period count into account. This should make things much easier to
understand.
This commit removes MA_BASE_BUFFER_SIZE_IN_MILLISECONDS_LOW_LATENCY and
MA_BASE_BUFFER_SIZE_IN_MILLISECONDS_CONSERVATIVE.
This commit removes ma_get_default_buffer_size_in_milliseconds() and
ma_get_default_buffer_size_in_frames().
This commit changes the following APIs to add an additional parameter
called pAllocationCallbacks. This is a pointer to a
ma_allocation_callbacks structure which is used to perform the actual
allocation/free.
Allocation callbacks can be set in ma_context_config for contexts and
ma_decoder_config for decoders. If it's left unset it will use
MA_MALLOC(), MA_REALLOC() and MA_FREE().