Commit Graph

2941 Commits

Author SHA1 Message Date
David Reid 88f8574197 Fix a bug when converting from stereo to mono.
Public issue https://github.com/mackron/miniaudio/issues/347
2021-07-21 20:37:42 +10:00
David Reid 5fe2e6e565 Merge branch 'master' into dev-0.11 2021-07-20 19:28:59 +10:00
David Reid 8bf157f10e Version 0.10.39 2021-07-20 19:27:24 +10:00
Steven Noonan 92f3644011 denormals: fix inverted logic in ma_device_{disable,restore}_denormals
It was only disabling denormals when "noDisableDenormals" was set, which
is the opposite of what was intended.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2021-07-20 19:18:15 +10:00
Steven Noonan 9bafb7fc2c denormals: enable denormal flushing on non-x86 Windows architectures as well
We can use _controlfp_s instead of _mm_getcsr/_mm_setcsr for
architecture-agnostic control of denormal behavior on Windows.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2021-07-20 19:17:49 +10:00
Steven Noonan d67eefdfe4 ma_yield: use __yield on ARM64 Windows
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2021-07-20 19:17:01 +10:00
Steven Noonan 02486fe78f miniaudio_libvorbis.h: only define OV_EXCLUDE_STATIC_CALLBACKS if not already defined
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2021-07-20 19:17:01 +10:00
David Reid 14a7f719b6 PulseAudio: Fix a null pointer dereference. 2021-07-20 19:04:46 +10:00
David Reid d7b68ff0c8 Fix a formatting bug. 2021-07-20 17:27:07 +10:00
David Reid bc4650b826 Add documentation for resource management and node graphs. 2021-07-19 20:39:37 +10:00
David Reid 79aca688de Make documentation narrower. 2021-07-19 19:39:37 +10:00
David Reid 3181b0c23e Fix a bug when decoding from memory. 2021-07-18 14:35:01 +10:00
David Reid 244ef260f2 Fix a bug where decoding would try to read 0 frames and throw an error. 2021-07-18 14:32:35 +10:00
David Reid 3ea1706194 Fix warnings on the 32-bit build. 2021-07-18 13:59:05 +10:00
David Reid 5f20002ad1 Bug fix for the previous commit. 2021-07-18 13:53:04 +10:00
David Reid a188eaae26 Add a safety net to catch EOF scenarios to the VFS.
This catches the case when backends do not return MA_AT_END when no
data is read.
2021-07-18 13:51:56 +10:00
David Reid c45afa011e Add a pedantic fread() compatibility check to the vorbis decoder. 2021-07-18 13:50:04 +10:00
David Reid 22965c2fc1 API CHANGE: Update ma_waveform_read_pcm_frames(). 2021-07-18 11:26:33 +10:00
David Reid 4eab967905 API CHANGE: Update ma_noise_read_pcm_frames(). 2021-07-18 11:14:09 +10:00
David Reid 02bf2a9e5a API CHANGE: Update ma_encoder_write_pcm_frames().
This updates ma_encoder_write_pcm_frames() to be consistent with
reading, where a result code is returned, and the number of frames
written is returned via an output parameter.
2021-07-18 10:41:04 +10:00
David Reid 7b65f3748a Add some safety checks to data sources.
With this change, an error is now returned when the requested frame
count is zero. Two reasons for this:

  1) It usually means there's an error in the higher level logic if
     something is trying to read zero frames.

  2) When no frames are read, MA_AT_END should be returned. However, if
     the input frame count is also zero, it creates ambiguity as to
     whether or not the data source is truly at the end.
2021-07-18 10:35:34 +10:00
David Reid d7d8520c82 Merge branch 'dev-0.11' of https://github.com/mackron/miniaudio into dev-0.11 2021-07-18 09:45:32 +10:00
David Reid cfb7020ae8 Add a null check to ma_free(). 2021-07-18 09:45:14 +10:00
David Reid 1b42dbb10e Move the engine API into the main library. 2021-07-18 08:00:17 +10:00
David Reid b19f403ac2 Move the node graph into the main library. 2021-07-18 07:47:59 +10:00
David Reid fa2fc03e1f Move a compile time option into the implementation section. 2021-07-17 22:12:48 +10:00
David Reid 5b574e652b Move resource manager into the main library. 2021-07-17 22:06:44 +10:00
David Reid 6effc9863a Move async notifications into the main library. 2021-07-17 21:04:08 +10:00
David Reid 2bd5ddd645 Renaming and fix a bug with the splitter node. 2021-07-17 20:05:07 +10:00
David Reid aae9a16cc3 Move some functions over to the main library. 2021-07-17 16:54:39 +10:00
David Reid 42d82c98cd API CHANGE: Remove ma_clip_pcm_frames_f32(). 2021-07-17 16:47:11 +10:00
David Reid 8ddac00d5c Move some clipping functions into the main library. 2021-07-17 16:46:30 +10:00
David Reid 9fa4d9ea7f Move ma_slot_allocator into the main library. 2021-07-17 16:38:06 +10:00
David Reid 711854647a Move ma_fence into the main library. 2021-07-17 16:32:27 +10:00
David Reid cc2b148598 Add support for configuring the size of the job queue.
This commit also decouples the job queue from the resource manager
which will make it easier to use in other areas if it ever comes up.
2021-07-17 14:47:30 +10:00
David Reid 0dc3e013f3 Fix a bug in ma_calculate_frame_count_after_resampling(). 2021-07-17 13:36:32 +10:00
David Reid 49599adcaf Decouple the slot allocator from the resource manager. 2021-07-17 13:27:54 +10:00
David Reid 503670532d Properly namespace some tokens. 2021-07-17 12:38:38 +10:00
David Reid faf3381f49 Update documentation for resource management. 2021-07-17 12:30:01 +10:00
David Reid 71909188f7 Merge branch 'dev' into dev-0.11 2021-07-17 12:25:09 +10:00
David Reid 36779c368b PulseAudio: Enable the stop callback when a stream is suspended.
Public issue https://github.com/mackron/miniaudio/issues/341
2021-07-17 12:19:40 +10:00
David Reid 5dd8fbe9ad Improvements to the main worker thread.
* If starting the backend fails, don't attempt to enter the data loop
  * If stopping the backend fails, don't fire the stop callback.
2021-07-17 12:13:42 +10:00
David Reid 07e56c70cf Core Audio: Try fixing a deadlock when switching devices.
Public issue https://github.com/mackron/miniaudio/issues/344
2021-07-17 11:23:01 +10:00
David Reid af70f1bd5d Update revision history. 2021-07-17 10:29:11 +10:00
David Reid efcaa21981 Core Audio: Fix compilation errors. 2021-07-17 10:26:04 +10:00
David Reid 1982364b89 Minor rearrangement of some code. 2021-07-17 08:29:36 +10:00
David Reid e13f00b336 Standardize some parameter names. 2021-07-16 19:40:33 +10:00
David Reid 9a7b9b8c38 API CHANGE: Remove ma_scale_buffer_size(). 2021-07-16 19:38:30 +10:00
David Reid b8079f2b61 Remove some unnecessary casts. 2021-07-16 19:36:11 +10:00
David Reid 36d74d0111 Move ma_copy_and_apply_volume_factor_per_channel_f32() into main file. 2021-07-16 19:35:24 +10:00