From d9478014cddcf00f035c950637917d2280a67ab2 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sun, 25 Oct 2026 10:10:28 +0300
Subject: [PATCH] update dr_flac and dr_mp3 from mainstream (Oct.25, 2026)
---
src/dr_libs/dr_flac.h | 664 +++++++++++-------------------------------
src/dr_libs/dr_mp3.h | 536 ++++++++--------------------------
2 files changed, 297 insertions(+), 903 deletions(-)
diff --git a/src/dr_libs/dr_flac.h b/src/dr_libs/dr_flac.h
index 051f37c6..f811bcfa 100644
--- a/src/dr_libs/dr_flac.h
+++ b/src/dr_libs/dr_flac.h
@@ -1635,11 +1635,12 @@ typedef drflac_int32 drflac_result;
#define DRFLAC_CHANNEL_ASSIGNMENT_RIGHT_SIDE 9
#define DRFLAC_CHANNEL_ASSIGNMENT_MID_SIDE 10
+#define drflac_align(x, a) ((((x) + (a) - 1) / (a)) * (a))
+
#define DRFLAC_SEEKPOINT_SIZE_IN_BYTES 18
#define DRFLAC_CUESHEET_TRACK_SIZE_IN_BYTES 36
#define DRFLAC_CUESHEET_TRACK_INDEX_SIZE_IN_BYTES 12
-
-#define drflac_align(x, a) ((((x) + (a) - 1) / (a)) * (a))
+#define DRFLAC_CUESHEET_TRACK_PADDED_SIZE_IN_BYTES drflac_align(DRFLAC_CUESHEET_TRACK_SIZE_IN_BYTES, sizeof(drflac_uint64))
DRFLAC_API void drflac_version(drflac_uint32* pMajor, drflac_uint32* pMinor, drflac_uint32* pRevision)
@@ -4586,7 +4587,7 @@ static drflac_bool32 drflac__decode_samples_with_residual__rice__neon_64(drflac_
int32x4_t riceParam128;
int64x1_t shift64;
uint32x4_t one128;
- int64x2_t prediction128 = { 0 };
+ int64x2_t prediction128;
uint32x4_t zeroCountPart128;
uint32x4_t riceParamPart128;
@@ -4686,7 +4687,7 @@ static drflac_bool32 drflac__decode_samples_with_residual__rice__neon_64(drflac_
for (i = 0; i < 4; i += 1) {
int64x1_t prediction64;
- prediction128 = veorq_s64(prediction128, prediction128); /* Reset to 0. */
+ prediction128 = vdupq_n_s64(0);
switch (order)
{
case 12:
@@ -5872,6 +5873,28 @@ location.
*/
#define DRFLAC_BINARY_SEARCH_APPROX_COMPRESSION_RATIO 0.6f
+static drflac_bool32 drflac__read_and_decode_next_flac_frame_for_seek(drflac* pFlac)
+{
+ DRFLAC_ASSERT(pFlac != NULL);
+
+ for (;;) {
+ drflac_result result;
+
+ if (!drflac__read_next_flac_frame_header(&pFlac->bs, pFlac->bitsPerSample, &pFlac->currentFLACFrame.header)) {
+ return DRFLAC_FALSE;
+ }
+
+ result = drflac__decode_flac_frame(pFlac);
+ if (result == DRFLAC_SUCCESS) {
+ return DRFLAC_TRUE;
+ }
+
+ if (result == DRFLAC_AT_END) {
+ return DRFLAC_FALSE;
+ }
+ }
+}
+
static drflac_bool32 drflac__seek_to_approximate_flac_frame_to_byte(drflac* pFlac, drflac_uint64 targetByte, drflac_uint64 rangeLo, drflac_uint64 rangeHi, drflac_uint64* pLastSuccessfulSeekOffset)
{
DRFLAC_ASSERT(pFlac != NULL);
@@ -5882,9 +5905,6 @@ static drflac_bool32 drflac__seek_to_approximate_flac_frame_to_byte(drflac* pFla
*pLastSuccessfulSeekOffset = pFlac->firstFLACFramePosInBytes;
for (;;) {
- /* After rangeLo == rangeHi == targetByte fails, we need to break out. */
- drflac_uint64 lastTargetByte = targetByte;
-
/* When seeking to a byte, failure probably means we've attempted to seek beyond the end of the stream. To counter this we just halve it each attempt. */
if (!drflac__seek_to_byte(&pFlac->bs, targetByte)) {
/* If we couldn't even seek to the first byte in the stream we have a problem. Just abandon the whole thing. */
@@ -5893,9 +5913,13 @@ static drflac_bool32 drflac__seek_to_approximate_flac_frame_to_byte(drflac* pFla
return DRFLAC_FALSE;
}
- /* Halve the byte location and continue. */
- targetByte = rangeLo + ((rangeHi - rangeLo)/2);
rangeHi = targetByte;
+ if (rangeHi <= rangeLo) {
+ return DRFLAC_FALSE;
+ }
+
+ /* Halve the reduced byte range and continue. */
+ targetByte = rangeLo + ((rangeHi - rangeLo)/2);
} else {
/* Getting here should mean that we have seeked to an appropriate byte. */
@@ -5907,28 +5931,31 @@ static drflac_bool32 drflac__seek_to_approximate_flac_frame_to_byte(drflac* pFla
CRC check and return bad data. We need to decode the entire frame to be more certain. Although this seems unlikely, this has happened to me in testing
so it needs to stay this way for now.
*/
-#if 1
- if (!drflac__read_and_decode_next_flac_frame(pFlac)) {
- /* Halve the byte location and continue. */
- targetByte = rangeLo + ((rangeHi - rangeLo)/2);
- rangeHi = targetByte;
- } else {
- break;
+ #if 1
+ {
+ if (!drflac__read_and_decode_next_flac_frame_for_seek(pFlac)) {
+ rangeHi = targetByte;
+ if (rangeHi <= rangeLo) {
+ return DRFLAC_FALSE;
+ }
+
+ /* Halve the byte location and continue. */
+ targetByte = rangeLo + ((rangeHi - rangeLo)/2);
+ } else {
+ break;
+ }
}
-#else
- if (!drflac__read_next_flac_frame_header(&pFlac->bs, pFlac->bitsPerSample, &pFlac->currentFLACFrame.header)) {
- /* Halve the byte location and continue. */
- targetByte = rangeLo + ((rangeHi - rangeLo)/2);
- rangeHi = targetByte;
- } else {
- break;
+ #else
+ {
+ if (!drflac__read_next_flac_frame_header(&pFlac->bs, pFlac->bitsPerSample, &pFlac->currentFLACFrame.header)) {
+ /* Halve the byte location and continue. */
+ targetByte = rangeLo + ((rangeHi - rangeLo)/2);
+ rangeHi = targetByte;
+ } else {
+ break;
+ }
}
-#endif
- }
-
- /* We already tried this byte and there are no more to try, break out. */
- if(targetByte == lastTargetByte) {
- return DRFLAC_FALSE;
+ #endif
}
}
@@ -5974,11 +6001,17 @@ static drflac_bool32 drflac__seek_to_pcm_frame__binary_search_internal(drflac* p
}
for (;;) {
+ drflac_uint64 previousByteRangeLo;
+ drflac_uint64 previousByteRangeHi;
+
+ previousByteRangeLo = byteRangeLo;
+ previousByteRangeHi = byteRangeHi;
+
/*
If only two adjacent byte offsets remain, binary search cannot narrow the range any further. Seek to the closest frame before the target and decode
forward from there.
*/
- if ((byteRangeHi - byteRangeLo) == 1) {
+ if ((byteRangeHi - byteRangeLo) <= 1) {
if (!drflac__seek_to_approximate_flac_frame_to_byte(pFlac, closestSeekOffsetBeforeTargetPCMFrame, closestSeekOffsetBeforeTargetPCMFrame, byteRangeHi, &lastSuccessfulSeekOffset)) {
break;
}
@@ -6060,6 +6093,22 @@ static drflac_bool32 drflac__seek_to_pcm_frame__binary_search_internal(drflac* p
}
}
}
+
+ if (byteRangeLo == previousByteRangeLo && byteRangeHi == previousByteRangeHi) {
+ if (!drflac__seek_to_approximate_flac_frame_to_byte(pFlac, closestSeekOffsetBeforeTargetPCMFrame, closestSeekOffsetBeforeTargetPCMFrame, byteRangeHi, &lastSuccessfulSeekOffset)) {
+ break;
+ }
+
+ if (pFlac->currentPCMFrame <= pcmFrameIndex && drflac__decode_flac_frame_and_seek_forward_by_pcm_frames(pFlac, pcmFrameIndex - pFlac->currentPCMFrame)) {
+ return DRFLAC_TRUE;
+ }
+
+ break;
+ }
+
+ if ((byteRangeHi - byteRangeLo) > 1 && (targetByte <= byteRangeLo || targetByte >= byteRangeHi)) {
+ targetByte = byteRangeLo + ((byteRangeHi - byteRangeLo) / 2);
+ }
} else {
/* Getting here is really bad. We just recover as best we can, but moving to the first frame in the stream, and then abort. */
break;
@@ -6572,7 +6621,7 @@ static drflac_bool32 drflac__read_and_decode_metadata(drflac_read_proc onRead, d
}
metadata.pRawData = pRawData;
- metadata.rawDataSize = rawDataSize;
+ metadata.rawDataSize = (drflac_uint32)rawDataSize;
metadata.data.seektable.seekpointCount = seekpointCount;
metadata.data.seektable.pSeekpoints = (const drflac_seekpoint*)pRawData;
@@ -6695,7 +6744,7 @@ static drflac_bool32 drflac__read_and_decode_metadata(drflac_read_proc onRead, d
{
const char* pRunningDataSaved = pRunningData; /* Will be restored at the end in preparation for the second pass. */
- bufferSize = metadata.data.cuesheet.trackCount * DRFLAC_CUESHEET_TRACK_SIZE_IN_BYTES;
+ bufferSize = metadata.data.cuesheet.trackCount * DRFLAC_CUESHEET_TRACK_PADDED_SIZE_IN_BYTES;
for (iTrack = 0; iTrack < metadata.data.cuesheet.trackCount; ++iTrack) {
drflac_uint8 indexCount;
@@ -6749,7 +6798,7 @@ static drflac_bool32 drflac__read_and_decode_metadata(drflac_read_proc onRead, d
/* Grab the index count for the next part. */
indexCount = pRunningData[0];
pRunningData += 1;
- pRunningTrackData += 1;
+ pRunningTrackData += 1 + (DRFLAC_CUESHEET_TRACK_PADDED_SIZE_IN_BYTES - DRFLAC_CUESHEET_TRACK_SIZE_IN_BYTES);
/* Extract each track index. */
for (iIndex = 0; iIndex < indexCount; ++iIndex) {
@@ -6766,12 +6815,10 @@ static drflac_bool32 drflac__read_and_decode_metadata(drflac_read_proc onRead, d
metadata.data.cuesheet.pTrackData = pTrackData;
}
- /* The original data is no longer needed. */
- drflac__free_from_callbacks(pRawData, pAllocationCallbacks);
- pRawData = NULL;
-
onMeta(pUserDataMD, &metadata);
+ drflac__free_from_callbacks(pRawData, pAllocationCallbacks);
+ pRawData = NULL;
drflac__free_from_callbacks(pTrackData, pAllocationCallbacks);
pTrackData = NULL;
}
@@ -9286,8 +9333,29 @@ static DRFLAC_INLINE void drflac_read_pcm_frames_s32__decode_left_side__neon(drf
}
#endif
+static DRFLAC_INLINE void drflac_read_pcm_frames_s32__decode_duplicate_mono(drflac_uint64 frameCount, drflac_uint32 shift, const drflac_int32* pInputSamples, drflac_int32* pOutputSamples)
+{
+ drflac_uint64 i;
+ const drflac_uint32* pInputSamplesU32 = (const drflac_uint32*)pInputSamples;
+
+ DRFLAC_ASSERT(shift < 32);
+
+ for (i = 0; i < frameCount; ++i) {
+ drflac_int32 sample;
+
+ sample = (drflac_int32)(pInputSamplesU32[i] << shift);
+ pOutputSamples[i*2+0] = sample;
+ pOutputSamples[i*2+1] = sample;
+ }
+}
+
static DRFLAC_INLINE void drflac_read_pcm_frames_s32__decode_left_side(drflac* pFlac, drflac_uint64 frameCount, drflac_uint32 unusedBitsPerSample, const drflac_int32* pInputSamples0, const drflac_int32* pInputSamples1, drflac_int32* pOutputSamples)
{
+ if (unusedBitsPerSample + pFlac->currentFLACFrame.subframes[1].wastedBitsPerSample == 32) {
+ drflac_read_pcm_frames_s32__decode_duplicate_mono(frameCount, unusedBitsPerSample + pFlac->currentFLACFrame.subframes[0].wastedBitsPerSample, pInputSamples0, pOutputSamples);
+ return;
+ }
+
#if defined(DRFLAC_SUPPORT_SSE2)
if (drflac__gIsSSE2Supported && pFlac->bitsPerSample <= 24) {
drflac_read_pcm_frames_s32__decode_left_side__sse2(pFlac, frameCount, unusedBitsPerSample, pInputSamples0, pInputSamples1, pOutputSamples);
@@ -9442,6 +9510,11 @@ static DRFLAC_INLINE void drflac_read_pcm_frames_s32__decode_right_side__neon(dr
static DRFLAC_INLINE void drflac_read_pcm_frames_s32__decode_right_side(drflac* pFlac, drflac_uint64 frameCount, drflac_uint32 unusedBitsPerSample, const drflac_int32* pInputSamples0, const drflac_int32* pInputSamples1, drflac_int32* pOutputSamples)
{
+ if (unusedBitsPerSample + pFlac->currentFLACFrame.subframes[0].wastedBitsPerSample == 32) {
+ drflac_read_pcm_frames_s32__decode_duplicate_mono(frameCount, unusedBitsPerSample + pFlac->currentFLACFrame.subframes[1].wastedBitsPerSample, pInputSamples1, pOutputSamples);
+ return;
+ }
+
#if defined(DRFLAC_SUPPORT_SSE2)
if (drflac__gIsSSE2Supported && pFlac->bitsPerSample <= 24) {
drflac_read_pcm_frames_s32__decode_right_side__sse2(pFlac, frameCount, unusedBitsPerSample, pInputSamples0, pInputSamples1, pOutputSamples);
@@ -9890,12 +9963,19 @@ static DRFLAC_INLINE void drflac_read_pcm_frames_s32__decode_independent_stereo(
static drflac_bool32 drflac__is_current_flac_frame_valid(drflac* pFlac)
{
drflac_uint32 iChannel;
+ drflac_uint32 channelCount;
if (pFlac->currentFLACFrame.header.blockSizeInPCMFrames > pFlac->maxBlockSizeInPCMFrames || pFlac->currentFLACFrame.pcmFramesRemaining > pFlac->currentFLACFrame.header.blockSizeInPCMFrames) {
return DRFLAC_FALSE;
}
- for (iChannel = 0; iChannel < pFlac->channels; iChannel += 1) {
+ /* The frame's channel count must agree with STREAMINFO, otherwise the subframes below may not have been decoded. */
+ channelCount = drflac__get_channel_count_from_channel_assignment(pFlac->currentFLACFrame.header.channelAssignment);
+ if (channelCount != pFlac->channels) {
+ return DRFLAC_FALSE;
+ }
+
+ for (iChannel = 0; iChannel < channelCount; iChannel += 1) {
if (pFlac->currentFLACFrame.subframes[iChannel].pSamplesS32 == NULL) {
return DRFLAC_FALSE;
}
@@ -10145,8 +10225,29 @@ static DRFLAC_INLINE void drflac_read_pcm_frames_s16__decode_left_side__neon(drf
}
#endif
+static DRFLAC_INLINE void drflac_read_pcm_frames_s16__decode_duplicate_mono(drflac_uint64 frameCount, drflac_uint32 shift, const drflac_int32* pInputSamples, drflac_int16* pOutputSamples)
+{
+ drflac_uint64 i;
+ const drflac_uint32* pInputSamplesU32 = (const drflac_uint32*)pInputSamples;
+
+ DRFLAC_ASSERT(shift < 32);
+
+ for (i = 0; i < frameCount; ++i) {
+ drflac_int16 sample;
+
+ sample = (drflac_int16)((pInputSamplesU32[i] << shift) >> 16);
+ pOutputSamples[i*2+0] = sample;
+ pOutputSamples[i*2+1] = sample;
+ }
+}
+
static DRFLAC_INLINE void drflac_read_pcm_frames_s16__decode_left_side(drflac* pFlac, drflac_uint64 frameCount, drflac_uint32 unusedBitsPerSample, const drflac_int32* pInputSamples0, const drflac_int32* pInputSamples1, drflac_int16* pOutputSamples)
{
+ if (unusedBitsPerSample + pFlac->currentFLACFrame.subframes[1].wastedBitsPerSample == 32) {
+ drflac_read_pcm_frames_s16__decode_duplicate_mono(frameCount, unusedBitsPerSample + pFlac->currentFLACFrame.subframes[0].wastedBitsPerSample, pInputSamples0, pOutputSamples);
+ return;
+ }
+
#if defined(DRFLAC_SUPPORT_SSE2)
if (drflac__gIsSSE2Supported && pFlac->bitsPerSample <= 24) {
drflac_read_pcm_frames_s16__decode_left_side__sse2(pFlac, frameCount, unusedBitsPerSample, pInputSamples0, pInputSamples1, pOutputSamples);
@@ -10328,6 +10429,11 @@ static DRFLAC_INLINE void drflac_read_pcm_frames_s16__decode_right_side__neon(dr
static DRFLAC_INLINE void drflac_read_pcm_frames_s16__decode_right_side(drflac* pFlac, drflac_uint64 frameCount, drflac_uint32 unusedBitsPerSample, const drflac_int32* pInputSamples0, const drflac_int32* pInputSamples1, drflac_int16* pOutputSamples)
{
+ if (unusedBitsPerSample + pFlac->currentFLACFrame.subframes[0].wastedBitsPerSample == 32) {
+ drflac_read_pcm_frames_s16__decode_duplicate_mono(frameCount, unusedBitsPerSample + pFlac->currentFLACFrame.subframes[1].wastedBitsPerSample, pInputSamples1, pOutputSamples);
+ return;
+ }
+
#if defined(DRFLAC_SUPPORT_SSE2)
if (drflac__gIsSSE2Supported && pFlac->bitsPerSample <= 24) {
drflac_read_pcm_frames_s16__decode_right_side__sse2(pFlac, frameCount, unusedBitsPerSample, pInputSamples0, pInputSamples1, pOutputSamples);
@@ -11044,8 +11150,32 @@ static DRFLAC_INLINE void drflac_read_pcm_frames_f32__decode_left_side__neon(drf
}
#endif
+static DRFLAC_INLINE void drflac_read_pcm_frames_f32__decode_duplicate_mono(drflac_uint64 frameCount, drflac_uint32 shift, const drflac_int32* pInputSamples, float* pOutputSamples)
+{
+ drflac_uint64 i;
+ const drflac_uint32* pInputSamplesU32 = (const drflac_uint32*)pInputSamples;
+ float factor;
+
+ DRFLAC_ASSERT(shift < 32);
+
+ factor = 1 / 2147483648.0f;
+
+ for (i = 0; i < frameCount; ++i) {
+ float sample;
+
+ sample = (drflac_int32)(pInputSamplesU32[i] << shift) * factor;
+ pOutputSamples[i*2+0] = sample;
+ pOutputSamples[i*2+1] = sample;
+ }
+}
+
static DRFLAC_INLINE void drflac_read_pcm_frames_f32__decode_left_side(drflac* pFlac, drflac_uint64 frameCount, drflac_uint32 unusedBitsPerSample, const drflac_int32* pInputSamples0, const drflac_int32* pInputSamples1, float* pOutputSamples)
{
+ if (unusedBitsPerSample + pFlac->currentFLACFrame.subframes[1].wastedBitsPerSample == 32) {
+ drflac_read_pcm_frames_f32__decode_duplicate_mono(frameCount, unusedBitsPerSample + pFlac->currentFLACFrame.subframes[0].wastedBitsPerSample, pInputSamples0, pOutputSamples);
+ return;
+ }
+
#if defined(DRFLAC_SUPPORT_SSE2)
if (drflac__gIsSSE2Supported && pFlac->bitsPerSample <= 24) {
drflac_read_pcm_frames_f32__decode_left_side__sse2(pFlac, frameCount, unusedBitsPerSample, pInputSamples0, pInputSamples1, pOutputSamples);
@@ -11212,6 +11342,11 @@ static DRFLAC_INLINE void drflac_read_pcm_frames_f32__decode_right_side__neon(dr
static DRFLAC_INLINE void drflac_read_pcm_frames_f32__decode_right_side(drflac* pFlac, drflac_uint64 frameCount, drflac_uint32 unusedBitsPerSample, const drflac_int32* pInputSamples0, const drflac_int32* pInputSamples1, float* pOutputSamples)
{
+ if (unusedBitsPerSample + pFlac->currentFLACFrame.subframes[0].wastedBitsPerSample == 32) {
+ drflac_read_pcm_frames_f32__decode_duplicate_mono(frameCount, unusedBitsPerSample + pFlac->currentFLACFrame.subframes[1].wastedBitsPerSample, pInputSamples1, pOutputSamples);
+ return;
+ }
+
#if defined(DRFLAC_SUPPORT_SSE2)
if (drflac__gIsSSE2Supported && pFlac->bitsPerSample <= 24) {
drflac_read_pcm_frames_f32__decode_right_side__sse2(pFlac, frameCount, unusedBitsPerSample, pInputSamples0, pInputSamples1, pOutputSamples);
@@ -12239,7 +12374,7 @@ DRFLAC_API drflac_bool32 drflac_next_cuesheet_track(drflac_cuesheet_track_iterat
DRFLAC_COPY_MEMORY(cuesheetTrack.ISRC, pRunningData, sizeof(cuesheetTrack.ISRC)); pRunningData += 12;
cuesheetTrack.isAudio = (pRunningData[0] & 0x80) != 0;
cuesheetTrack.preEmphasis = (pRunningData[0] & 0x40) != 0; pRunningData += 14;
- cuesheetTrack.indexCount = pRunningData[0]; pRunningData += 1;
+ cuesheetTrack.indexCount = pRunningData[0]; pRunningData += 1 + (DRFLAC_CUESHEET_TRACK_PADDED_SIZE_IN_BYTES - DRFLAC_CUESHEET_TRACK_SIZE_IN_BYTES);
cuesheetTrack.pIndexPoints = (const drflac_cuesheet_track_index*)pRunningData; pRunningData += cuesheetTrack.indexCount * sizeof(drflac_cuesheet_track_index);
pIter->pRunningData = pRunningData;
@@ -12258,457 +12393,6 @@ DRFLAC_API drflac_bool32 drflac_next_cuesheet_track(drflac_cuesheet_track_iterat
#endif /* dr_flac_c */
#endif /* DR_FLAC_IMPLEMENTATION */
-
-/*
-REVISION HISTORY
-================
-v0.13.4 - TBD
- - Add a bounds check when allocating memory during metadata processing.
- - Fix a possible overflow error when parsing picture metadata.
- - Fix an error with seek point parsing.
- - Fix a possible deadlock when seeking.
- - Fix an error where the decoder can be put into a bad state when seeking fails which then results in a crash when reading and seeking.
-
-v0.13.3 - 2026-01-17
- - Fix a compiler compatibility issue with some inlined assembly.
- - Fix a compilation warning.
-
-v0.13.2 - 2025-12-02
- - Improve robustness of the parsing of picture metadata to improve support for memory constrained embedded devices.
- - Fix a warning about an assigned by unused variable.
- - Improvements to drflac_open_and_read_pcm_frames_*() and family to avoid excessively large memory allocations from malformed files.
-
-v0.13.1 - 2025-09-10
- - Fix an error with the NXDK build.
-
-v0.13.0 - 2025-07-23
- - API CHANGE: Seek origin enums have been renamed to match the naming convention used by other dr_libs libraries:
- - drflac_seek_origin_start -> DRFLAC_SEEK_SET
- - drflac_seek_origin_current -> DRFLAC_SEEK_CUR
- - DRFLAC_SEEK_END (new)
- - API CHANGE: A new seek origin has been added to allow seeking from the end of the file. If you implement your own `onSeek` callback, you should now detect and handle `DRFLAC_SEEK_END`. If seeking to the end is not supported, return `DRFLAC_FALSE`. If you only use `*_open_file()` or `*_open_memory()`, you need not change anything.
- - API CHANGE: An `onTell` callback has been added to the following functions:
- - drflac_open()
- - drflac_open_relaxed()
- - drflac_open_with_metadata()
- - drflac_open_with_metadata_relaxed()
- - drflac_open_and_read_pcm_frames_s32()
- - drflac_open_and_read_pcm_frames_s16()
- - drflac_open_and_read_pcm_frames_f32()
- - Fix compilation for AIX OS.
-
-v0.12.43 - 2024-12-17
- - Fix a possible buffer overflow during decoding.
- - Improve detection of ARM64EC
-
-v0.12.42 - 2023-11-02
- - Fix build for ARMv6-M.
- - Fix a compilation warning with GCC.
-
-v0.12.41 - 2023-06-17
- - Fix an incorrect date in revision history. No functional change.
-
-v0.12.40 - 2023-05-22
- - Minor code restructure. No functional change.
-
-v0.12.39 - 2022-09-17
- - Fix compilation with DJGPP.
- - Fix compilation error with Visual Studio 2019 and the ARM build.
- - Fix an error with SSE 4.1 detection.
- - Add support for disabling wchar_t with DR_WAV_NO_WCHAR.
- - Improve compatibility with compilers which lack support for explicit struct packing.
- - Improve compatibility with low-end and embedded hardware by reducing the amount of stack
- allocation when loading an Ogg encapsulated file.
-
-v0.12.38 - 2022-04-10
- - Fix compilation error on older versions of GCC.
-
-v0.12.37 - 2022-02-12
- - Improve ARM detection.
-
-v0.12.36 - 2022-02-07
- - Fix a compilation error with the ARM build.
-
-v0.12.35 - 2022-02-06
- - Fix a bug due to underestimating the amount of precision required for the prediction stage.
- - Fix some bugs found from fuzz testing.
-
-v0.12.34 - 2022-01-07
- - Fix some misalignment bugs when reading metadata.
-
-v0.12.33 - 2021-12-22
- - Fix a bug with seeking when the seek table does not start at PCM frame 0.
-
-v0.12.32 - 2021-12-11
- - Fix a warning with Clang.
-
-v0.12.31 - 2021-08-16
- - Silence some warnings.
-
-v0.12.30 - 2021-07-31
- - Fix platform detection for ARM64.
-
-v0.12.29 - 2021-04-02
- - Fix a bug where the running PCM frame index is set to an invalid value when over-seeking.
- - Fix a decoding error due to an incorrect validation check.
-
-v0.12.28 - 2021-02-21
- - Fix a warning due to referencing _MSC_VER when it is undefined.
-
-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.
-
-v0.12.23 - 2020-11-21
- - Fix compilation with OpenWatcom.
-
-v0.12.22 - 2020-11-01
- - Fix an error with the previous release.
-
-v0.12.21 - 2020-11-01
- - Fix a possible deadlock when seeking.
- - Improve compiler support for older versions of GCC.
-
-v0.12.20 - 2020-09-08
- - Fix a compilation error on older compilers.
-
-v0.12.19 - 2020-08-30
- - Fix a bug due to an undefined 32-bit shift.
-
-v0.12.18 - 2020-08-14
- - Fix a crash when compiling with clang-cl.
-
-v0.12.17 - 2020-08-02
- - Simplify sized types.
-
-v0.12.16 - 2020-07-25
- - Fix a compilation warning.
-
-v0.12.15 - 2020-07-06
- - Check for negative LPC shifts and return an error.
-
-v0.12.14 - 2020-06-23
- - Add include guard for the implementation section.
-
-v0.12.13 - 2020-05-16
- - Add compile-time and run-time version querying.
- - DRFLAC_VERSION_MINOR
- - DRFLAC_VERSION_MAJOR
- - DRFLAC_VERSION_REVISION
- - DRFLAC_VERSION_STRING
- - drflac_version()
- - drflac_version_string()
-
-v0.12.12 - 2020-04-30
- - Fix compilation errors with VC6.
-
-v0.12.11 - 2020-04-19
- - Fix some pedantic warnings.
- - Fix some undefined behaviour warnings.
-
-v0.12.10 - 2020-04-10
- - Fix some bugs when trying to seek with an invalid seek table.
-
-v0.12.9 - 2020-04-05
- - Fix warnings.
-
-v0.12.8 - 2020-04-04
- - Add drflac_open_file_w() and drflac_open_file_with_metadata_w().
- - Fix some static analysis warnings.
- - Minor documentation updates.
-
-v0.12.7 - 2020-03-14
- - Fix compilation errors with VC6.
-
-v0.12.6 - 2020-03-07
- - Fix compilation error with Visual Studio .NET 2003.
-
-v0.12.5 - 2020-01-30
- - Silence some static analysis warnings.
-
-v0.12.4 - 2020-01-29
- - Silence some static analysis warnings.
-
-v0.12.3 - 2019-12-02
- - Fix some warnings when compiling with GCC and the -Og flag.
- - Fix a crash in out-of-memory situations.
- - Fix potential integer overflow bug.
- - Fix some static analysis warnings.
- - Fix a possible crash when using custom memory allocators without a custom realloc() implementation.
- - Fix a bug with binary search seeking where the bits per sample is not a multiple of 8.
-
-v0.12.2 - 2019-10-07
- - Internal code clean up.
-
-v0.12.1 - 2019-09-29
- - Fix some Clang Static Analyzer warnings.
- - Fix an unused variable warning.
-
-v0.12.0 - 2019-09-23
- - API CHANGE: Add support for user defined memory allocation routines. This system allows the program to specify their own memory allocation
- routines with a user data pointer for client-specific contextual data. This adds an extra parameter to the end of the following APIs:
- - drflac_open()
- - drflac_open_relaxed()
- - drflac_open_with_metadata()
- - drflac_open_with_metadata_relaxed()
- - drflac_open_file()
- - drflac_open_file_with_metadata()
- - drflac_open_memory()
- - drflac_open_memory_with_metadata()
- - drflac_open_and_read_pcm_frames_s32()
- - drflac_open_and_read_pcm_frames_s16()
- - drflac_open_and_read_pcm_frames_f32()
- - drflac_open_file_and_read_pcm_frames_s32()
- - drflac_open_file_and_read_pcm_frames_s16()
- - drflac_open_file_and_read_pcm_frames_f32()
- - drflac_open_memory_and_read_pcm_frames_s32()
- - drflac_open_memory_and_read_pcm_frames_s16()
- - drflac_open_memory_and_read_pcm_frames_f32()
- Set this extra parameter to NULL to use defaults which is the same as the previous behaviour. Setting this NULL will use
- DRFLAC_MALLOC, DRFLAC_REALLOC and DRFLAC_FREE.
- - Remove deprecated APIs:
- - drflac_read_s32()
- - drflac_read_s16()
- - drflac_read_f32()
- - drflac_seek_to_sample()
- - drflac_open_and_decode_s32()
- - drflac_open_and_decode_s16()
- - drflac_open_and_decode_f32()
- - drflac_open_and_decode_file_s32()
- - drflac_open_and_decode_file_s16()
- - drflac_open_and_decode_file_f32()
- - drflac_open_and_decode_memory_s32()
- - drflac_open_and_decode_memory_s16()
- - drflac_open_and_decode_memory_f32()
- - Remove drflac.totalSampleCount which is now replaced with drflac.totalPCMFrameCount. You can emulate drflac.totalSampleCount
- by doing pFlac->totalPCMFrameCount*pFlac->channels.
- - Rename drflac.currentFrame to drflac.currentFLACFrame to remove ambiguity with PCM frames.
- - Fix errors when seeking to the end of a stream.
- - Optimizations to seeking.
- - SSE improvements and optimizations.
- - ARM NEON optimizations.
- - Optimizations to drflac_read_pcm_frames_s16().
- - Optimizations to drflac_read_pcm_frames_s32().
-
-v0.11.10 - 2019-06-26
- - Fix a compiler error.
-
-v0.11.9 - 2019-06-16
- - Silence some ThreadSanitizer warnings.
-
-v0.11.8 - 2019-05-21
- - Fix warnings.
-
-v0.11.7 - 2019-05-06
- - C89 fixes.
-
-v0.11.6 - 2019-05-05
- - Add support for C89.
- - Fix a compiler warning when CRC is disabled.
- - Change license to choice of public domain or MIT-0.
-
-v0.11.5 - 2019-04-19
- - Fix a compiler error with GCC.
-
-v0.11.4 - 2019-04-17
- - Fix some warnings with GCC when compiling with -std=c99.
-
-v0.11.3 - 2019-04-07
- - Silence warnings with GCC.
-
-v0.11.2 - 2019-03-10
- - Fix a warning.
-
-v0.11.1 - 2019-02-17
- - Fix a potential bug with seeking.
-
-v0.11.0 - 2018-12-16
- - API CHANGE: Deprecated drflac_read_s32(), drflac_read_s16() and drflac_read_f32() and replaced them with
- drflac_read_pcm_frames_s32(), drflac_read_pcm_frames_s16() and drflac_read_pcm_frames_f32(). The new APIs take
- and return PCM frame counts instead of sample counts. To upgrade you will need to change the input count by
- dividing it by the channel count, and then do the same with the return value.
- - API_CHANGE: Deprecated drflac_seek_to_sample() and replaced with drflac_seek_to_pcm_frame(). Same rules as
- the changes to drflac_read_*() apply.
- - API CHANGE: Deprecated drflac_open_and_decode_*() and replaced with drflac_open_*_and_read_*(). Same rules as
- the changes to drflac_read_*() apply.
- - Optimizations.
-
-v0.10.0 - 2018-09-11
- - Remove the DR_FLAC_NO_WIN32_IO option and the Win32 file IO functionality. If you need to use Win32 file IO you
- need to do it yourself via the callback API.
- - Fix the clang build.
- - Fix undefined behavior.
- - Fix errors with CUESHEET metdata blocks.
- - Add an API for iterating over each cuesheet track in the CUESHEET metadata block. This works the same way as the
- Vorbis comment API.
- - Other miscellaneous bug fixes, mostly relating to invalid FLAC streams.
- - Minor optimizations.
-
-v0.9.11 - 2018-08-29
- - Fix a bug with sample reconstruction.
-
-v0.9.10 - 2018-08-07
- - Improve 64-bit detection.
-
-v0.9.9 - 2018-08-05
- - Fix C++ build on older versions of GCC.
-
-v0.9.8 - 2018-07-24
- - Fix compilation errors.
-
-v0.9.7 - 2018-07-05
- - Fix a warning.
-
-v0.9.6 - 2018-06-29
- - Fix some typos.
-
-v0.9.5 - 2018-06-23
- - Fix some warnings.
-
-v0.9.4 - 2018-06-14
- - Optimizations to seeking.
- - Clean up.
-
-v0.9.3 - 2018-05-22
- - Bug fix.
-
-v0.9.2 - 2018-05-12
- - Fix a compilation error due to a missing break statement.
-
-v0.9.1 - 2018-04-29
- - Fix compilation error with Clang.
-
-v0.9 - 2018-04-24
- - Fix Clang build.
- - Start using major.minor.revision versioning.
-
-v0.8g - 2018-04-19
- - Fix build on non-x86/x64 architectures.
-
-v0.8f - 2018-02-02
- - Stop pretending to support changing rate/c
(Patch may be truncated, please check the link at the top of this post.)