mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 12bacf1186 | |||
| 117366df9a | |||
| 0041150de0 | |||
| 52d09d3688 | |||
| 6922366bb1 | |||
| 4c082afe71 |
@@ -1,3 +1,8 @@
|
|||||||
|
v0.11.26 - TBD
|
||||||
|
=====================
|
||||||
|
* Fixed a crash when passing in null for the read or seek callbacks for a decoder.
|
||||||
|
|
||||||
|
|
||||||
v0.11.25 - 2026-03-04
|
v0.11.25 - 2026-03-04
|
||||||
=====================
|
=====================
|
||||||
* Bug fixes to the WAV decoder.
|
* Bug fixes to the WAV decoder.
|
||||||
|
|||||||
+19
-3
@@ -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.
|
Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file.
|
||||||
miniaudio - v0.11.25 - 2026-03-04
|
miniaudio - v0.11.26 - TBD
|
||||||
|
|
||||||
David Reid - mackron@gmail.com
|
David Reid - mackron@gmail.com
|
||||||
|
|
||||||
@@ -3747,7 +3747,7 @@ extern "C" {
|
|||||||
|
|
||||||
#define MA_VERSION_MAJOR 0
|
#define MA_VERSION_MAJOR 0
|
||||||
#define MA_VERSION_MINOR 11
|
#define MA_VERSION_MINOR 11
|
||||||
#define MA_VERSION_REVISION 25
|
#define MA_VERSION_REVISION 26
|
||||||
#define MA_VERSION_STRING MA_XSTRINGIFY(MA_VERSION_MAJOR) "." MA_XSTRINGIFY(MA_VERSION_MINOR) "." MA_XSTRINGIFY(MA_VERSION_REVISION)
|
#define MA_VERSION_STRING MA_XSTRINGIFY(MA_VERSION_MAJOR) "." MA_XSTRINGIFY(MA_VERSION_MINOR) "." MA_XSTRINGIFY(MA_VERSION_REVISION)
|
||||||
|
|
||||||
#if defined(_MSC_VER) && !defined(__clang__)
|
#if defined(_MSC_VER) && !defined(__clang__)
|
||||||
@@ -9974,7 +9974,19 @@ typedef struct
|
|||||||
} ma_decoding_backend_vtable;
|
} ma_decoding_backend_vtable;
|
||||||
|
|
||||||
|
|
||||||
typedef ma_result (* ma_decoder_read_proc)(ma_decoder* pDecoder, void* pBufferOut, size_t bytesToRead, size_t* pBytesRead); /* Returns the number of bytes read. */
|
/*
|
||||||
|
The read callback should return MA_SUCCESS if more than zero bytes were successfully read. If zero
|
||||||
|
bytes can be read because it reached the end of the file, return MA_AT_END. If any other error
|
||||||
|
occurs just return any other error code (it's fine to just generically return MA_ERROR).
|
||||||
|
|
||||||
|
Return the actual number of bytes read in `pBytesRead`. Important note: if the number of bytes
|
||||||
|
actually read is less than the number of bytes requested (bytesToRead), miniaudio will treat it as
|
||||||
|
if the end of the file has been reached and it will stop decoding. This becomes relevant for things
|
||||||
|
like streaming data sources, such as internet streams. If you haven't yet received `bytesToRead`
|
||||||
|
from the network, you need to have your callback wait for it and then only return when the full
|
||||||
|
number of bytes can be output, or when you've reached the genuine end of the stream.
|
||||||
|
*/
|
||||||
|
typedef ma_result (* ma_decoder_read_proc)(ma_decoder* pDecoder, void* pBufferOut, size_t bytesToRead, size_t* pBytesRead);
|
||||||
typedef ma_result (* ma_decoder_seek_proc)(ma_decoder* pDecoder, ma_int64 byteOffset, ma_seek_origin origin);
|
typedef ma_result (* ma_decoder_seek_proc)(ma_decoder* pDecoder, ma_int64 byteOffset, ma_seek_origin origin);
|
||||||
typedef ma_result (* ma_decoder_tell_proc)(ma_decoder* pDecoder, ma_int64* pCursor);
|
typedef ma_result (* ma_decoder_tell_proc)(ma_decoder* pDecoder, ma_int64* pCursor);
|
||||||
|
|
||||||
@@ -62853,6 +62865,10 @@ static ma_result ma_decoder_seek_bytes(ma_decoder* pDecoder, ma_int64 byteOffset
|
|||||||
{
|
{
|
||||||
MA_ASSERT(pDecoder != NULL);
|
MA_ASSERT(pDecoder != NULL);
|
||||||
|
|
||||||
|
if (pDecoder->onSeek == NULL) {
|
||||||
|
return MA_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
return pDecoder->onSeek(pDecoder, byteOffset, origin);
|
return pDecoder->onSeek(pDecoder, byteOffset, origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user