Commit Graph

1788 Commits

Author SHA1 Message Date
David Reid 11acb0caa5 Prep work in preparation for some changes to data sources.
Public issue https://github.com/mackron/miniaudio/issues/290
2021-05-03 15:35:07 +10:00
David Reid 236da866eb Silence some warnings when compiling with MA_DEBUG_OUTPUT. 2021-05-02 09:44:50 +10:00
David Reid 199d6a7875 Version 0.10.35 2021-04-27 17:31:19 +10:00
David Reid 3c80311743 Fix the C++ build. 2021-04-27 17:25:46 +10:00
David Reid 994cda44b5 Version 0.10.34 2021-04-26 16:32:00 +10:00
David Reid 16a605eebd Cleanup. 2021-04-26 16:28:57 +10:00
David Reid 24a8d433ac Clean up some debug output. 2021-04-26 16:22:02 +10:00
David Reid 50786617a8 ALSA: Add some debug output. 2021-04-26 13:15:13 +10:00
David Reid 8dc54984ec ALSA: Improvements to reading and writing logic.
Public issue https://github.com/mackron/miniaudio/issues/291
2021-04-26 12:36:25 +10:00
David Reid db53bdfc17 Fix a memory leak. 2021-04-26 12:07:54 +10:00
David Reid 403e9f7a74 ALSA: Fix a deadlock when stopping devices.
Public issue https://github.com/mackron/miniaudio/issues/291
2021-04-26 11:54:52 +10:00
David Reid 95bd7fb53b Update revision history. 2021-04-20 18:49:04 +10:00
David Reid 41b72f660c WASAPI: Attempt to fix a bug with loopback mode.
Public issue https://github.com/mackron/miniaudio/issues/298
2021-04-20 17:43:36 +10:00
David Reid 7ecd1e5b40 Fix a bug when using default data formats in loopback mode.
Public issue https://github.com/mackron/miniaudio/issues/298
2021-04-19 19:38:53 +10:00
David Reid 2f9f618434 Fix a bug in ma_encoder_init_file_w().
Public issue https://github.com/mackron/miniaudio/issues/297
2021-04-19 18:46:43 +10:00
David Reid f31bdb15fc Fix an error in some documentation. 2021-04-18 12:25:53 +10:00
Giovanni Petrantoni b00175209d Merge branch 'dev' of git://github.com/mackron/miniaudio 2021-04-18 09:12:51 +09:00
Giovanni Petrantoni 1c09a5d7b8 Merge branch 'master' of git://github.com/mackron/miniaudio 2021-04-18 09:05:28 +09:00
Giovanni Petrantoni 32d28747a8 Attempt to fix ubsan issue under macOS #295 2021-04-18 08:56:54 +09:00
David Reid a7e9b5dd5e Update revision history. 2021-04-08 09:11:51 +10:00
David Reid 821c057daa WASAPI: Fix a bug where a result code is not getting checked.
This was not propagating the result code when retrieving the render or
capture client from an audio client.
2021-04-08 09:08:58 +10:00
David Reid f28d61e493 Mark devices as default on the null backend. 2021-04-05 13:09:31 +10:00
David Reid fca829edef Version 0.10.33 2021-04-04 08:04:50 +10:00
David Reid 881fa6063e Update dr_flac. 2021-04-02 08:52:00 +10:00
David Reid eef66940c2 Fix a bug when calculating buffer sizes.
This fixes the following APIs:

  * ma_calculate_buffer_size_in_milliseconds_from_frames()
  * ma_calculate_buffer_size_in_frames_from_milliseconds()

Public issue https://github.com/mackron/miniaudio/issues/283
2021-03-21 08:07:57 +10:00
David Reid ba3e73cb22 Update revision history. 2021-03-21 07:57:53 +10:00
David Reid 64749431dd Update c89atomic. 2021-03-21 07:56:29 +10:00
David Reid f57673d861 Merge pull request #284 from tycho/pr/clang-optimizations
Clang auto-vectorization hints
2021-03-21 07:51:37 +10:00
David Reid a02f559581 JACK: Add support for loading JACK from libjack64.dll. 2021-03-16 18:20:14 +10:00
Steven Noonan 8a1858eba6 use MA_ASSUME for channel counts before loops
The range of the value isn't obvious to any compiler, as it could go for
one iteration or 4 billion iterations. Adding MA_ASSUME in these places
helps the compiler understand the range of possible values, and know how
heavily to vectorize (or not vectorize) these loops.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2021-03-15 04:10:10 -07:00
Steven Noonan c1451b30a4 apply MA_RESTRICT to linear resampler interpolation functions
This tells the compiler that pFrameOut does not alias to pointers used
within the function, and teaches Clang that the loop is vectorizable.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2021-03-15 04:10:09 -07:00
Steven Noonan c88bb8ccd2 extract channel count constants from loops
These values are constant, but Clang has some trouble noticing that,
especially if the loop body is complex enough. This prevents it from
noticing places where vectorization is possible (and desirable).

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2021-03-15 04:10:08 -07:00
Steven Noonan 2dcce6d53b introduce MA_RESTRICT macro
This allows us to use the __restrict keyword in places where we know
that pointers do not alias.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2021-03-13 22:33:54 -08:00
Steven Noonan 5472d84180 introduce MA_ASSUME macro
This macro can be used to tell the compiler's optimization passes static
assumptions which you *know* are true about code behavior.

Use of these can be risky -- if you assume incorrectly, the compiler may
emit code that will not work in circumstances you didn't anticipate.

On the other hand, use of this macro in places where the optimizer is
missing an assumption that would have been safe to make can cause it to
emit more compact/optimal code.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2021-03-13 21:07:11 -08:00
Steven Noonan c9e2258dae introduce MA_COMPILER_HAS_BUILTIN macro
Both GCC and Clang can use this feature, so let's make it more general.

I didn't touch the dr_wav/dr_flac parts using this, since I figure the
amalgamated miniaudio.h header isn't the primary source for those.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2021-03-13 21:07:10 -08:00
Steven Noonan e4ff49d558 wasapi: ensure that wasapi context structure is zeroed before filling it
I had a situation where I was doing:

    ma_backend backends[] = {
	ma_backend_jack,
	ma_backend_wasapi,
    };
    ma_context_init(backends, sizeof(backends)/sizeof(backends[0]),
	&contextConfig, &context);

And since JACK was unavailable, it fell back to WASAPI. When this
happened, the WASAPI commandIndex and commandCount variables were
already stomped on by the JACK backend initialization, but the WASAPI
backend assumes they are zero-initialized.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2021-03-10 07:48:26 -08:00
David Reid de1219158d Merge pull request #280 from morlad/fix-warning-1
Fix -Wcast-qual by using correct ma_offset_pcm_frames_ptr()
2021-03-10 17:38:11 +10:00
David Reid feae709042 Update revision history. 2021-03-10 17:34:41 +10:00
David Reid 551ce040ae Merge pull request #279 from morlad/fix-audio-latency-1
Fix CoreAudio's performanceProfile for playback not being set
2021-03-10 17:35:35 +10:00
David Reid d9016e2036 Merge branch 'dev' of https://github.com/mackron/miniaudio into dev 2021-03-10 17:31:49 +10:00
David Reid cd65ffe939 Merge pull request #278 from morlad/fix-memory-leak-1
Fix memory leak (macOS)
2021-03-10 17:32:36 +10:00
David Reid ecffc00ccf Update revision history. 2021-03-10 17:31:42 +10:00
David Reid c12730bcab Update c89atomic. 2021-03-10 17:23:38 +10:00
morlad (iLeitgeb) c2fd23c983 Fix CoreAudio's performanceProfile for playback not being set 2021-03-10 06:45:21 +00:00
morlad (iLeitgeb) eadd717397 Fix -Wcast-qual by using correct ma_offset_pcm_frames_ptr() 2021-03-10 06:42:46 +00:00
morlad (iLeitgeb) 6f22b36eb7 Fix memory leak (macOS) 2021-03-10 06:39:10 +00:00
David Reid 53eed5b5f2 Silence some -Wmaybe-uninitialized warnings. 2021-03-09 20:51:31 +10:00
David Reid a06ca7ee04 Prevent a division by zero. 2021-03-04 17:19:23 +10:00
David Reid c2c32ed1d7 Fix a typo. 2021-03-01 17:39:03 +10:00
David Reid d5ba84605c Fix a typo in the date for the previous version in revision history. 2021-02-26 17:09:29 +10:00