Updated external libraries

This commit is contained in:
Ray
2018-02-09 00:00:47 +01:00
parent 2ace360230
commit f72b315cb6
6 changed files with 726 additions and 305 deletions

View File

@ -1,5 +1,5 @@
// Audio playback and capture library. Public domain. See "unlicense" statement at the end of this file.
// mini_al - v0.x - xxxx-xx-xx
// mini_al - v0.6b - 2018-02-03
//
// David Reid - davidreidsoftware@gmail.com
@ -1774,7 +1774,10 @@ typedef HWND (WINAPI * MAL_PFN_GetDesktopWindow)();
#define mal_buffer_frame_capacity(buffer, channels, format) (sizeof(buffer) / mal_get_sample_size_in_bytes(format) / (channels))
// Some of these string utility functions are unused on some platforms.
#if defined(__GNUC__)
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4505)
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif
@ -1972,7 +1975,9 @@ static int mal_strcmp(const char* str1, const char* str2)
return ((unsigned char*)str1)[0] - ((unsigned char*)str2)[0];
}
#if defined(__GNUC__)
#if defined(_MSC_VER)
#pragma warning(pop)
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
@ -8843,6 +8848,8 @@ mal_result mal_device_init__sdl(mal_context* pContext, mal_device_type type, mal
mal_assert(pConfig != NULL);
mal_assert(pDevice != NULL);
(void)pContext;
// SDL wants the buffer size to be a power of 2. The SDL_AudioSpec property for this is only a Uint16, so we need
// to explicitly clamp this because it will be easy to overflow.
mal_uint32 bufferSize = pConfig->bufferSizeInFrames;
@ -10760,7 +10767,7 @@ static void mal_dsp_mix_channels__inc(float* pFramesOut, mal_uint32 channelsOut,
(void)channelMapOut;
(void)channelMapIn;
if (mode == mal_channel_mix_mode_basic) {\
if (mode == mal_channel_mix_mode_basic) {
// Basic mode is where we just zero out extra channels.
for (mal_uint32 iFrame = 0; iFrame < frameCount; ++iFrame) {
switch (channelsIn) {
@ -10785,23 +10792,23 @@ static void mal_dsp_mix_channels__inc(float* pFramesOut, mal_uint32 channelsOut,
// Zero out extra channels.
switch (channelsOut - channelsIn) {
case 17: pFramesOut[iFrame*channelsOut+16] = 0;
case 16: pFramesOut[iFrame*channelsOut+15] = 0;
case 15: pFramesOut[iFrame*channelsOut+14] = 0;
case 14: pFramesOut[iFrame*channelsOut+13] = 0;
case 13: pFramesOut[iFrame*channelsOut+12] = 0;
case 12: pFramesOut[iFrame*channelsOut+11] = 0;
case 11: pFramesOut[iFrame*channelsOut+10] = 0;
case 10: pFramesOut[iFrame*channelsOut+ 9] = 0;
case 9: pFramesOut[iFrame*channelsOut+ 8] = 0;
case 8: pFramesOut[iFrame*channelsOut+ 7] = 0;
case 7: pFramesOut[iFrame*channelsOut+ 6] = 0;
case 6: pFramesOut[iFrame*channelsOut+ 5] = 0;
case 5: pFramesOut[iFrame*channelsOut+ 4] = 0;
case 4: pFramesOut[iFrame*channelsOut+ 3] = 0;
case 3: pFramesOut[iFrame*channelsOut+ 2] = 0;
case 2: pFramesOut[iFrame*channelsOut+ 1] = 0;
case 1: pFramesOut[iFrame*channelsOut+ 0] = 0;
case 17: pFramesOut[iFrame*channelsOut+16 + channelsIn] = 0;
case 16: pFramesOut[iFrame*channelsOut+15 + channelsIn] = 0;
case 15: pFramesOut[iFrame*channelsOut+14 + channelsIn] = 0;
case 14: pFramesOut[iFrame*channelsOut+13 + channelsIn] = 0;
case 13: pFramesOut[iFrame*channelsOut+12 + channelsIn] = 0;
case 12: pFramesOut[iFrame*channelsOut+11 + channelsIn] = 0;
case 11: pFramesOut[iFrame*channelsOut+10 + channelsIn] = 0;
case 10: pFramesOut[iFrame*channelsOut+ 9 + channelsIn] = 0;
case 9: pFramesOut[iFrame*channelsOut+ 8 + channelsIn] = 0;
case 8: pFramesOut[iFrame*channelsOut+ 7 + channelsIn] = 0;
case 7: pFramesOut[iFrame*channelsOut+ 6 + channelsIn] = 0;
case 6: pFramesOut[iFrame*channelsOut+ 5 + channelsIn] = 0;
case 5: pFramesOut[iFrame*channelsOut+ 4 + channelsIn] = 0;
case 4: pFramesOut[iFrame*channelsOut+ 3 + channelsIn] = 0;
case 3: pFramesOut[iFrame*channelsOut+ 2 + channelsIn] = 0;
case 2: pFramesOut[iFrame*channelsOut+ 1 + channelsIn] = 0;
case 1: pFramesOut[iFrame*channelsOut+ 0 + channelsIn] = 0;
}
}
} else {
@ -10832,10 +10839,10 @@ static void mal_dsp_mix_channels__inc(float* pFramesOut, mal_uint32 channelsOut,
}
} else if (channelsIn == 2) {
// TODO: Implement an optimized stereo conversion.
mal_dsp_mix_channels__dec(pFramesOut, channelsOut, channelMapOut, pFramesIn, channelsIn, channelMapIn, frameCount, mal_channel_mix_mode_basic);
mal_dsp_mix_channels__inc(pFramesOut, channelsOut, channelMapOut, pFramesIn, channelsIn, channelMapIn, frameCount, mal_channel_mix_mode_basic);
} else {
// Fall back to basic mixing mode.
mal_dsp_mix_channels__dec(pFramesOut, channelsOut, channelMapOut, pFramesIn, channelsIn, channelMapIn, frameCount, mal_channel_mix_mode_basic);
mal_dsp_mix_channels__inc(pFramesOut, channelsOut, channelMapOut, pFramesIn, channelsIn, channelMapIn, frameCount, mal_channel_mix_mode_basic);
}
}
}
@ -11494,7 +11501,11 @@ void mal_pcm_f32_to_s32(int* pOut, const float* pIn, unsigned int count)
// REVISION HISTORY
// ================
//
// v0.x - xxxx-xx-xx
// v0.6b - 2018-02-03
// - Fix some warnings when compiling with Visual C++.
//
// v0.6a - 2018-01-26
// - Fix errors with channel mixing when increasing the channel count.
// - Improvements to the build system for the OpenAL backend.
// - Documentation fixes.
//