mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
Update external libraries and fix C++ on older versions of GCC.
This commit is contained in:
+21
-2
@@ -1,5 +1,5 @@
|
||||
// MP3 audio decoder. Public domain. See "unlicense" statement at the end of this file.
|
||||
// dr_mp3 - v0.2.8 - 2018-08-02
|
||||
// dr_mp3 - v0.2.9 - 2018-08-05
|
||||
//
|
||||
// David Reid - mackron@gmail.com
|
||||
//
|
||||
@@ -1915,6 +1915,11 @@ int drmp3dec_decode_frame(drmp3dec *dec, const unsigned char *mp3, int mp3_bytes
|
||||
info->layer = 4 - DRMP3_HDR_GET_LAYER(hdr);
|
||||
info->bitrate_kbps = drmp3_hdr_bitrate_kbps(hdr);
|
||||
|
||||
if (!pcm)
|
||||
{
|
||||
return drmp3_hdr_frame_samples(hdr);
|
||||
}
|
||||
|
||||
drmp3_bs_init(bs_frame, hdr + DRMP3_HDR_SIZE, frame_size - DRMP3_HDR_SIZE);
|
||||
if (DRMP3_HDR_IS_CRC(hdr))
|
||||
{
|
||||
@@ -1979,6 +1984,16 @@ int drmp3dec_decode_frame(drmp3dec *dec, const unsigned char *mp3, int mp3_bytes
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(SIZE_MAX)
|
||||
#define DRMP3_SIZE_MAX SIZE_MAX
|
||||
#else
|
||||
#if defined(_WIN64) || defined(__ppc64__) || defined(__x86_64__) || defined(_M_X64) || defined(_M_ARM64) || defined(__aarch64__)
|
||||
#define DRMP3_SIZE_MAX ((drmp3_uint64)0xFFFFFFFFFFFFFFFF)
|
||||
#else
|
||||
#define DRMP3_SIZE_MAX 0xFFFFFFFF
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Options.
|
||||
#ifndef DR_MP3_DEFAULT_CHANNELS
|
||||
#define DR_MP3_DEFAULT_CHANNELS 2
|
||||
@@ -2656,7 +2671,7 @@ float* drmp3__full_decode_and_close_f32(drmp3* pMP3, drmp3_config* pConfig, drmp
|
||||
}
|
||||
|
||||
drmp3_uint64 newFramesBufferSize = framesCapacity*pMP3->channels*sizeof(float);
|
||||
if (newFramesBufferSize > SIZE_MAX) {
|
||||
if (newFramesBufferSize > DRMP3_SIZE_MAX) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2746,6 +2761,10 @@ void drmp3_free(void* p)
|
||||
// REVISION HISTORY
|
||||
// ===============
|
||||
//
|
||||
// v0.2.9 - 2018-08-05
|
||||
// - Fix C++ build on older versions of GCC.
|
||||
// - Bring up to date with minimp3.
|
||||
//
|
||||
// v0.2.8 - 2018-08-02
|
||||
// - Fix compilation errors with older versions of GCC.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user