8000 Support {Net,Open}BSD OSS by a3f · Pull Request #12 · mackron/miniaudio · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions mini_al.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Audio playback and capture library. Public domain. See "unlicense" statement at the end of this file.
// mini_al - v0.6a - 2018-01-26
// mini_al - v0.6b - 2018-02-03
//
// David Reid - davidreidsoftware@gmail.com

Expand Down Expand Up @@ -59,7 +59,7 @@
//
// Building (BSD)
// --------------
// The BSD build uses OSS and should Just Work without any linking nor include path configuration.
// BSD build uses OSS. Requires linking to -lossaudio on {Open,Net}BSD, but not FreeBSD.
//
// Building (Emscripten)
// ---------------------
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -6707,6 +6712,10 @@ static mal_result mal_device__main_loop__alsa(mal_device* pDevice)
#include <fcntl.h>
#include <sys/soundcard.h>

#ifndef SNDCTL_DSP_HALT
#define SNDCTL_DSP_HALT SNDCTL_DSP_RESET
#endif

int mal_open_temp_device__oss()
{
// The OSS sample code uses "/dev/mixer" as the device for getting system properties so I'm going to do the same.
Expand Down Expand Up @@ -8843,6 +8852,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;
Expand Down Expand Up @@ -11494,6 +11505,9 @@ void mal_pcm_f32_to_s32(int* pOut, const float* pIn, unsigned int count)
// REVISION HISTORY
// ================
//
// 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.
Expand Down
0