Updating dr_libs libraries

This commit is contained in:
Georgy Treshchev
2021-02-20 10:23:45 +01:00
parent 4cbafaef81
commit 4ebebe268f
3 changed files with 239 additions and 235 deletions
+32 -9
View File
@@ -1,6 +1,6 @@
/*
FLAC audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file.
dr_flac - v0.12.24 - 2020-11-29
dr_flac - v0.12.27 - 2021-01-31
David Reid - mackron@gmail.com
@@ -166,7 +166,7 @@ If you just want to quickly decode an entire FLAC file in one go you can do some
...
drflac_free(pSampleData);
drflac_free(pSampleData, NULL);
```
You can read samples as signed 16-bit integer and 32-bit floating-point PCM with the *_s16() and *_f32() family of APIs respectively, but note that these
@@ -232,7 +232,7 @@ extern "C" {
#define DRFLAC_VERSION_MAJOR 0
#define DRFLAC_VERSION_MINOR 12
#define DRFLAC_VERSION_REVISION 24
#define DRFLAC_VERSION_REVISION 27
#define DRFLAC_VERSION_STRING DRFLAC_XSTRINGIFY(DRFLAC_VERSION_MAJOR) "." DRFLAC_XSTRINGIFY(DRFLAC_VERSION_MINOR) "." DRFLAC_XSTRINGIFY(DRFLAC_VERSION_REVISION)
#include <stddef.h> /* For size_t. */
@@ -408,7 +408,10 @@ typedef struct
typedef struct
{
/* The metadata type. Use this to know how to interpret the data below. */
/*
The metadata type. Use this to know how to interpret the data below. Will be set to one of the
DRFLAC_METADATA_BLOCK_TYPE_* tokens.
*/
drflac_uint32 type;
/*
@@ -552,7 +555,8 @@ pMetadata (in)
Remarks
-------
Use pMetadata->type to determine which metadata block is being handled and how to read the data.
Use pMetadata->type to determine which metadata block is being handled and how to read the data. This
will be set to one of the DRFLAC_METADATA_BLOCK_TYPE_* tokens.
*/
typedef void (* drflac_meta_proc)(void* pUserData, drflac_metadata* pMetadata);
@@ -797,6 +801,8 @@ from a block of memory respectively.
The STREAMINFO block must be present for this to succeed. Use `drflac_open_relaxed()` to open a FLAC stream where the header may not be present.
Use `drflac_open_with_metadata()` if you need access to metadata.
Seek Also
---------
@@ -843,6 +849,8 @@ as that is for internal use only.
Opening in relaxed mode will continue reading data from onRead until it finds a valid frame. If a frame is never found it will continue forever. To abort,
force your `onRead` callback to return 0, which dr_flac will use as an indicator that the end of the stream was found.
Use `drflac_open_with_metadata_relaxed()` if you need access to metadata.
*/
DRFLAC_API drflac* drflac_open_relaxed(drflac_read_proc onRead, drflac_seek_proc onSeek, drflac_container container, void* pUserData, const drflac_allocation_callbacks* pAllocationCallbacks);
@@ -882,7 +890,9 @@ Close the decoder with `drflac_close()`.
This is slower than `drflac_open()`, so avoid this one if you don't need metadata. Internally, this will allocate and free memory on the heap for every
metadata block except for STREAMINFO and PADDING blocks.
The caller is notified of the metadata via the `onMeta` callback. All metadata blocks will be handled before the function returns.
The caller is notified of the metadata via the `onMeta` callback. All metadata blocks will be handled before the function returns. This callback takes a
pointer to a `drflac_metadata` object which is a union containing the data of all relevant metadata blocks. Use the `type` member to discriminate against
the different metadata types.
The STREAMINFO block must be present for this to succeed. Use `drflac_open_with_metadata_relaxed()` to open a FLAC stream where the header may not be present.
@@ -1330,6 +1340,9 @@ DRFLAC_API drflac_bool32 drflac_next_cuesheet_track(drflac_cuesheet_track_iterat
#ifndef _BSD_SOURCE
#define _BSD_SOURCE
#endif
#ifndef _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#endif
#ifndef __USE_BSD
#define __USE_BSD
#endif
@@ -5157,7 +5170,8 @@ static drflac_bool32 drflac__read_next_flac_frame_header(drflac_bs* bs, drflac_u
DRFLAC_ASSERT(blockSize > 0);
if (blockSize == 1) {
header->blockSizeInPCMFrames = 192;
} else if (blockSize >= 2 && blockSize <= 5) {
} else if (blockSize <= 5) {
DRFLAC_ASSERT(blockSize >= 2);
header->blockSizeInPCMFrames = 576 * (1 << (blockSize - 2));
} else if (blockSize == 6) {
if (!drflac__read_uint16(bs, 8, &header->blockSizeInPCMFrames)) {
@@ -8311,7 +8325,7 @@ static drflac_result drflac_result_from_errno(int e)
static drflac_result drflac_fopen(FILE** ppFile, const char* pFilePath, const char* pOpenMode)
{
#if defined(_MSC_VER) && defined(_MSC_VER) >= 1400
#if defined(_MSC_VER) && _MSC_VER >= 1400
errno_t err;
#endif
@@ -8323,7 +8337,7 @@ static drflac_result drflac_fopen(FILE** ppFile, const char* pFilePath, const ch
return DRFLAC_INVALID_ARGS;
}
#if defined(_MSC_VER) && defined(_MSC_VER) >= 1400
#if defined(_MSC_VER) && _MSC_VER >= 1400
err = fopen_s(ppFile, pFilePath, pOpenMode);
if (err != 0) {
return drflac_result_from_errno(err);
@@ -11792,6 +11806,15 @@ DRFLAC_API drflac_bool32 drflac_next_cuesheet_track(drflac_cuesheet_track_iterat
/*
REVISION HISTORY
================
v0.12.27 - 2021-01-31
- Fix a static analysis warning.
v0.12.26 - 2021-01-17
- Fix a compilation warning due to _BSD_SOURCE being deprecated.
v0.12.25 - 2020-12-26
- Update documentation.
v0.12.24 - 2020-11-29
- Fix ARM64/NEON detection when compiling with MSVC.
+20 -16
View File
@@ -1,6 +1,6 @@
/*
MP3 audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file.
dr_mp3 - v0.6.22 - 2020-12-02
dr_mp3 - v0.6.26 - 2021-01-31
David Reid - mackron@gmail.com
@@ -95,7 +95,7 @@ extern "C" {
#define DRMP3_VERSION_MAJOR 0
#define DRMP3_VERSION_MINOR 6
#define DRMP3_VERSION_REVISION 22
#define DRMP3_VERSION_REVISION 26
#define DRMP3_VERSION_STRING DRMP3_XSTRINGIFY(DRMP3_VERSION_MAJOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_MINOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_REVISION)
#include <stddef.h> /* For size_t. */
@@ -281,14 +281,6 @@ DRMP3_API void drmp3dec_f32_to_s16(const float *in, drmp3_int16 *out, size_t num
Main API (Pull API)
===================
*/
#ifndef DRMP3_DEFAULT_CHANNELS
#define DRMP3_DEFAULT_CHANNELS 2
#endif
#ifndef DRMP3_DEFAULT_SAMPLE_RATE
#define DRMP3_DEFAULT_SAMPLE_RATE 44100
#endif
typedef enum
{
drmp3_seek_origin_start,
@@ -1870,7 +1862,7 @@ static void drmp3d_DCT_II(float *grbuf, int n)
} else
#endif
#ifdef DR_MP3_ONLY_SIMD
{}
{} /* for HAVE_SIMD=1, MINIMP3_ONLY_SIMD=1 case we do not need non-intrinsic "else" branch */
#else
for (; k < n; k++)
{
@@ -2103,7 +2095,7 @@ static void drmp3d_synth(float *xl, drmp3d_sample_t *dstl, int nch, float *lins)
} else
#endif
#ifdef DR_MP3_ONLY_SIMD
{}
{} /* for HAVE_SIMD=1, MINIMP3_ONLY_SIMD=1 case we do not need non-intrinsic "else" branch */
#else
for (i = 14; i >= 0; i--)
{
@@ -2831,7 +2823,7 @@ static drmp3_bool32 drmp3_init_internal(drmp3* pMP3, drmp3_read_proc onRead, drm
/* Decode the first frame to confirm that it is indeed a valid MP3 stream. */
if (!drmp3_decode_next_frame(pMP3)) {
drmp3_uninit(pMP3);
drmp3__free_from_callbacks(pMP3->pData, &pMP3->allocationCallbacks); /* The call above may have allocated memory. Need to make sure it's freed before aborting. */
return DRMP3_FALSE; /* Not a valid MP3 stream. */
}
@@ -3527,7 +3519,7 @@ DRMP3_API void drmp3_uninit(drmp3* pMP3)
if (pMP3 == NULL) {
return;
}
#ifndef DR_MP3_NO_STDIO
if (pMP3->onRead == drmp3__on_read_stdio) {
FILE* pFile = (FILE*)pMP3->pUserData;
@@ -3915,7 +3907,7 @@ DRMP3_API drmp3_bool32 drmp3_get_mp3_and_pcm_frame_count(drmp3* pMP3, drmp3_uint
/* We'll need to seek back to where we were, so grab the PCM frame we're currently sitting on so we can restore later. */
currentPCMFrame = pMP3->currentPCMFrame;
if (!drmp3_seek_to_start_of_stream(pMP3)) {
return DRMP3_FALSE;
}
@@ -4013,7 +4005,7 @@ DRMP3_API drmp3_bool32 drmp3_calculate_seek_points(drmp3* pMP3, drmp3_uint32* pS
/* We'll need to seek back to the current sample after calculating the seekpoints so we need to go ahead and grab the current location at the top. */
currentPCMFrame = pMP3->currentPCMFrame;
/* We never do more than the total number of MP3 frames and we limit it to 32-bits. */
if (!drmp3_get_mp3_and_pcm_frame_count(pMP3, &totalMP3FrameCount, &totalPCMFrameCount)) {
return DRMP3_FALSE;
@@ -4458,6 +4450,18 @@ counts rather than sample counts.
/*
REVISION HISTORY
================
v0.6.26 - 2021-01-31
- Bring up to date with minimp3.
v0.6.25 - 2020-12-26
- Remove DRMP3_DEFAULT_CHANNELS and DRMP3_DEFAULT_SAMPLE_RATE which are leftovers from some removed APIs.
v0.6.24 - 2020-12-07
- Fix a typo in version date for 0.6.23.
v0.6.23 - 2020-12-03
- Fix an error where a file can be closed twice when initialization of the decoder fails.
v0.6.22 - 2020-12-02
- Fix an error where it's possible for a file handle to be left open when initialization of the decoder fails.
File diff suppressed because it is too large Load Diff