Version 0.10.17

This commit is contained in:
David Reid
2020-08-28 20:36:58 +10:00
parent 3b840235f9
commit a8557e82da
3 changed files with 41 additions and 14 deletions
+32 -10
View File
@@ -1,6 +1,6 @@
/*
Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file.
miniaudio - v0.10.16 - 2020-08-14
miniaudio - v0.10.17 - 2020-08-28
David Reid - davidreidsoftware@gmail.com
@@ -4498,7 +4498,7 @@ static ma_result ma_device__handle_duplex_callback_capture(ma_device* pDevice, m
break;
}
result = ma_pcm_rb_commit_write(pRB, (ma_uint32)framesProcessedInDeviceFormat, pFramesInClientFormat); /* Safe cast. */
result = ma_pcm_rb_commit_write(pRB, (ma_uint32)framesProcessedInClientFormat, pFramesInClientFormat); /* Safe cast. */
if (result != MA_SUCCESS) {
ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "Failed to commit capture PCM frames to ring buffer.", result);
break;
@@ -35942,7 +35942,7 @@ MA_API ma_uint64 ma_audio_buffer_read_pcm_frames(ma_audio_buffer* pAudioBuffer,
MA_ASSERT(pAudioBuffer->cursor < pAudioBuffer->sizeInFrames);
}
return frameCount;
return totalFramesRead;
}
MA_API ma_result ma_audio_buffer_seek_to_pcm_frame(ma_audio_buffer* pAudioBuffer, ma_uint64 frameIndex)
@@ -36851,7 +36851,7 @@ MA_API ma_result ma_default_vfs_init(ma_default_vfs* pVFS, const ma_allocation_c
Decoding and Encoding Headers. These are auto-generated from a tool.
**************************************************************************************************************************************************************/
#if !defined(MA_NO_WAV) && !defined(MA_NO_DECODING) && !defined(MA_NO_ENCODING)
#if !defined(MA_NO_WAV) && (!defined(MA_NO_DECODING) || !defined(MA_NO_ENCODING))
/* dr_wav_h begin */
#ifndef dr_wav_h
#define dr_wav_h
@@ -36862,7 +36862,7 @@ extern "C" {
#define DRWAV_XSTRINGIFY(x) DRWAV_STRINGIFY(x)
#define DRWAV_VERSION_MAJOR 0
#define DRWAV_VERSION_MINOR 12
#define DRWAV_VERSION_REVISION 9
#define DRWAV_VERSION_REVISION 10
#define DRWAV_VERSION_STRING DRWAV_XSTRINGIFY(DRWAV_VERSION_MAJOR) "." DRWAV_XSTRINGIFY(DRWAV_VERSION_MINOR) "." DRWAV_XSTRINGIFY(DRWAV_VERSION_REVISION)
#include <stddef.h>
typedef signed char drwav_int8;
@@ -38819,13 +38819,11 @@ static ma_result ma_decoder__data_source_on_get_data_format(ma_data_source* pDat
return MA_SUCCESS;
}
static ma_result ma_decoder__data_source_on_get_cursor(ma_data_source* pDataSource, ma_uint64* pCursor)
static ma_result ma_decoder__data_source_on_get_cursor(ma_data_source* pDataSource, ma_uint64* pLength)
{
ma_decoder* pDecoder = (ma_decoder*)pDataSource;
*pCursor = pDecoder->readPointerInPCMFrames;
return MA_SUCCESS;
return ma_decoder_get_cursor_in_pcm_frames(pDecoder, pLength);
}
static ma_result ma_decoder__data_source_on_get_length(ma_data_source* pDataSource, ma_uint64* pLength)
@@ -40023,6 +40021,23 @@ MA_API ma_result ma_decoder_uninit(ma_decoder* pDecoder)
return MA_SUCCESS;
}
MA_API ma_result ma_decoder_get_cursor_in_pcm_frames(ma_decoder* pDecoder, ma_uint64* pCursor)
{
if (pCursor == NULL) {
return MA_INVALID_ARGS;
}
*pCursor = 0;
if (pDecoder == NULL) {
return MA_INVALID_ARGS;
}
*pCursor = pDecoder->readPointerInPCMFrames;
return MA_SUCCESS;
}
MA_API ma_uint64 ma_decoder_get_length_in_pcm_frames(ma_decoder* pDecoder)
{
if (pDecoder == NULL) {
@@ -41371,7 +41386,7 @@ code below please report the bug to the respective repository for the relevant p
***************************************************************************************************************************************************************
**************************************************************************************************************************************************************/
#if !defined(MA_NO_WAV) && !defined(MA_NO_DECODING) && !defined(MA_NO_ENCODING)
#if !defined(MA_NO_WAV) && (!defined(MA_NO_DECODING) || !defined(MA_NO_ENCODING))
#if !defined(DR_WAV_IMPLEMENTATION) && !defined(DRWAV_IMPLEMENTATION) /* For backwards compatibility. Will be removed in version 0.11 for cleanliness. */
/* dr_wav_c begin */
#ifndef dr_wav_c
@@ -43407,6 +43422,13 @@ DRWAV_API drwav_bool32 drwav_seek_to_first_pcm_frame(drwav* pWav)
}
if (drwav__is_compressed_format_tag(pWav->translatedFormatTag)) {
pWav->compressed.iCurrentPCMFrame = 0;
if (pWav->translatedFormatTag == DR_WAVE_FORMAT_ADPCM) {
DRWAV_ZERO_OBJECT(&pWav->msadpcm);
} else if (pWav->translatedFormatTag == DR_WAVE_FORMAT_DVI_ADPCM) {
DRWAV_ZERO_OBJECT(&pWav->ima);
} else {
DRWAV_ASSERT(DRWAV_FALSE);
}
}
pWav->bytesRemaining = pWav->dataChunkDataSize;
return DRWAV_TRUE;