Skip to content

Commit 8675fcd

Browse files
committed
Revert "Buildfix"
This reverts commit 0e14bba.
1 parent 4668afc commit 8675fcd

3 files changed

Lines changed: 65 additions & 63 deletions

File tree

deps/dr/dr_flac.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5416,6 +5416,7 @@ static drflac_bool32 drflac__on_seek_ogg(void* pUserData, int offset, drflac_see
54165416
return DRFLAC_TRUE;
54175417
}
54185418

5419+
54195420
static drflac_bool32 drflac_ogg__seek_to_pcm_frame(drflac* pFlac, drflac_uint64 pcmFrameIndex)
54205421
{
54215422
drflac_oggbs* oggbs = (drflac_oggbs*)pFlac->_oggbs;
@@ -7749,7 +7750,8 @@ drflac_uint64 drflac_read_pcm_frames_f32(drflac* pFlac, drflac_uint64 framesToRe
77497750
return framesRead;
77507751
}
77517752

7752-
uint32_t drflac_seek_to_pcm_frame(drflac* pFlac, uint64_t pcmFrameIndex)
7753+
7754+
drflac_bool32 drflac_seek_to_pcm_frame(drflac* pFlac, drflac_uint64 pcmFrameIndex)
77537755
{
77547756
if (pFlac == NULL)
77557757
return DRFLAC_FALSE;

deps/dr/dr_flac.h

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,13 @@ David Reid - [email protected]
77
GitHub: https://github.com/mackron/dr_libs
88
*/
99

10-
#ifndef DR_FLAC_H
11-
#define DR_FLAC_H
10+
#ifndef dr_flac_h
11+
#define dr_flac_h
1212

1313
#ifdef __cplusplus
1414
extern "C" {
1515
#endif
1616

17-
#include <stdint.h>
18-
#include <stddef.h> /* For size_t. */
19-
2017
#define DRFLAC_STRINGIFY(x) #x
2118
#define DRFLAC_XSTRINGIFY(x) DRFLAC_STRINGIFY(x)
2219

@@ -25,6 +22,8 @@ extern "C" {
2522
#define DRFLAC_VERSION_REVISION 42
2623
#define DRFLAC_VERSION_STRING DRFLAC_XSTRINGIFY(DRFLAC_VERSION_MAJOR) "." DRFLAC_XSTRINGIFY(DRFLAC_VERSION_MINOR) "." DRFLAC_XSTRINGIFY(DRFLAC_VERSION_REVISION)
2724

25+
#include <stddef.h> /* For size_t. */
26+
2827
/* Sized Types */
2928
typedef signed char drflac_int8;
3029
typedef unsigned char drflac_uint8;
@@ -60,27 +59,6 @@ typedef drflac_uint32 drflac_bool32;
6059
#define DRFLAC_FALSE 0
6160
/* End Sized Types */
6261

63-
/*
64-
BIT READING ATTEMPT #2
65-
66-
This uses a 32- or 64-bit bit-shifted cache - as bits are read, the cache is shifted such that the first valid bit is sitting
67-
on the most significant bit. It uses the notion of an L1 and L2 cache (borrowed from CPU architecture), where the L1 cache
68-
is a 32- or 64-bit unsigned integer (depending on whether or not a 32- or 64-bit build is being compiled) and the L2 is an
69-
array of "cache lines", with each cache line being the same size as the L1. The L2 is a buffer of about 4KB and is where data
70-
from onRead() is read into.
71-
*/
72-
#define DRFLAC_CACHE_L1_SIZE_BYTES(bs) (sizeof((bs)->cache))
73-
#define DRFLAC_CACHE_L1_SIZE_BITS(bs) (sizeof((bs)->cache)*8)
74-
#define DRFLAC_CACHE_L1_BITS_REMAINING(bs) (DRFLAC_CACHE_L1_SIZE_BITS(bs) - (bs)->consumedBits)
75-
#define DRFLAC_CACHE_L1_SELECTION_MASK(_bitCount) (~((~(drflac_cache_t)0) >> (_bitCount)))
76-
#define DRFLAC_CACHE_L1_SELECTION_SHIFT(bs, _bitCount) (DRFLAC_CACHE_L1_SIZE_BITS(bs) - (_bitCount))
77-
#define DRFLAC_CACHE_L1_SELECT(bs, _bitCount) (((bs)->cache) & DRFLAC_CACHE_L1_SELECTION_MASK(_bitCount))
78-
#define DRFLAC_CACHE_L1_SELECT_AND_SHIFT(bs, _bitCount) (DRFLAC_CACHE_L1_SELECT((bs), (_bitCount)) >> DRFLAC_CACHE_L1_SELECTION_SHIFT((bs), (_bitCount)))
79-
#define DRFLAC_CACHE_L1_SELECT_AND_SHIFT_SAFE(bs, _bitCount)(DRFLAC_CACHE_L1_SELECT((bs), (_bitCount)) >> (DRFLAC_CACHE_L1_SELECTION_SHIFT((bs), (_bitCount)) & (DRFLAC_CACHE_L1_SIZE_BITS(bs)-1)))
80-
#define DRFLAC_CACHE_L2_SIZE_BYTES(bs) (sizeof((bs)->cacheL2))
81-
#define DRFLAC_CACHE_L2_LINE_COUNT(bs) (DRFLAC_CACHE_L2_SIZE_BYTES(bs) / sizeof((bs)->cacheL2[0]))
82-
#define DRFLAC_CACHE_L2_LINES_REMAINING(bs) (DRFLAC_CACHE_L2_LINE_COUNT(bs) - (bs)->nextL2Line)
83-
8462
/* Allocation Callbacks */
8563
typedef struct
8664
{
@@ -536,38 +514,6 @@ typedef struct
536514
drflac_uint8 pExtraData[1];
537515
} drflac;
538516

539-
/* Structure representing an iterator for vorbis comments in a VORBIS_COMMENT metadata block. */
540-
typedef struct
541-
{
542-
drflac_uint32 countRemaining;
543-
const char* pRunningData;
544-
} drflac_vorbis_comment_iterator;
545-
546-
/* Structure representing an iterator for cuesheet tracks in a CUESHEET metadata block. */
547-
typedef struct
548-
{
549-
drflac_uint32 countRemaining;
550-
const char* pRunningData;
551-
} drflac_cuesheet_track_iterator;
552-
553-
/* The order of members here is important because we map this directly to the raw data within the CUESHEET metadata block. */
554-
typedef struct
555-
{
556-
drflac_uint64 offset;
557-
drflac_uint8 index;
558-
drflac_uint8 reserved[3];
559-
} drflac_cuesheet_track_index;
560-
561-
typedef struct
562-
{
563-
drflac_uint64 offset;
564-
drflac_uint8 trackNumber;
565-
char ISRC[12];
566-
drflac_bool8 isAudio;
567-
drflac_bool8 preEmphasis;
568-
drflac_uint8 indexCount;
569-
const drflac_cuesheet_track_index* pIndexPoints;
570-
} drflac_cuesheet_track;
571517

572518
/*
573519
Opens a FLAC decoder.
@@ -770,7 +716,7 @@ Return Value
770716
-------------
771717
`DRFLAC_TRUE` if successful; `DRFLAC_FALSE` otherwise.
772718
*/
773-
uint32_t drflac_seek_to_pcm_frame(drflac* pFlac, uint64_t pcmFrameIndex);
719+
drflac_bool32 drflac_seek_to_pcm_frame(drflac* pFlac, drflac_uint64 pcmFrameIndex);
774720

775721
/*
776722
Opens a FLAC decoder from a pre-allocated block of memory
@@ -814,8 +760,62 @@ Set pAllocationCallbacks to the same object that was passed to drflac_open_*_and
814760
*/
815761
void drflac_free(void* p, const drflac_allocation_callbacks* pAllocationCallbacks);
816762

763+
764+
/* Structure representing an iterator for vorbis comments in a VORBIS_COMMENT metadata block. */
765+
typedef struct
766+
{
767+
drflac_uint32 countRemaining;
768+
const char* pRunningData;
769+
} drflac_vorbis_comment_iterator;
770+
771+
/* Structure representing an iterator for cuesheet tracks in a CUESHEET metadata block. */
772+
typedef struct
773+
{
774+
drflac_uint32 countRemaining;
775+
const char* pRunningData;
776+
} drflac_cuesheet_track_iterator;
777+
778+
/* The order of members here is important because we map this directly to the raw data within the CUESHEET metadata block. */
779+
typedef struct
780+
{
781+
drflac_uint64 offset;
782+
drflac_uint8 index;
783+
drflac_uint8 reserved[3];
784+
} drflac_cuesheet_track_index;
785+
786+
typedef struct
787+
{
788+
drflac_uint64 offset;
789+
drflac_uint8 trackNumber;
790+
char ISRC[12];
791+
drflac_bool8 isAudio;
792+
drflac_bool8 preEmphasis;
793+
drflac_uint8 indexCount;
794+
const drflac_cuesheet_track_index* pIndexPoints;
795+
} drflac_cuesheet_track;
796+
797+
/*
798+
BIT READING ATTEMPT #2
799+
800+
This uses a 32- or 64-bit bit-shifted cache - as bits are read, the cache is shifted such that the first valid bit is sitting
801+
on the most significant bit. It uses the notion of an L1 and L2 cache (borrowed from CPU architecture), where the L1 cache
802+
is a 32- or 64-bit unsigned integer (depending on whether or not a 32- or 64-bit build is being compiled) and the L2 is an
803+
array of "cache lines", with each cache line being the same size as the L1. The L2 is a buffer of about 4KB and is where data
804+
from onRead() is read into.
805+
*/
806+
#define DRFLAC_CACHE_L1_SIZE_BYTES(bs) (sizeof((bs)->cache))
807+
#define DRFLAC_CACHE_L1_SIZE_BITS(bs) (sizeof((bs)->cache)*8)
808+
#define DRFLAC_CACHE_L1_BITS_REMAINING(bs) (DRFLAC_CACHE_L1_SIZE_BITS(bs) - (bs)->consumedBits)
809+
#define DRFLAC_CACHE_L1_SELECTION_MASK(_bitCount) (~((~(drflac_cache_t)0) >> (_bitCount)))
810+
#define DRFLAC_CACHE_L1_SELECTION_SHIFT(bs, _bitCount) (DRFLAC_CACHE_L1_SIZE_BITS(bs) - (_bitCount))
811+
#define DRFLAC_CACHE_L1_SELECT(bs, _bitCount) (((bs)->cache) & DRFLAC_CACHE_L1_SELECTION_MASK(_bitCount))
812+
#define DRFLAC_CACHE_L1_SELECT_AND_SHIFT(bs, _bitCount) (DRFLAC_CACHE_L1_SELECT((bs), (_bitCount)) >> DRFLAC_CACHE_L1_SELECTION_SHIFT((bs), (_bitCount)))
813+
#define DRFLAC_CACHE_L1_SELECT_AND_SHIFT_SAFE(bs, _bitCount)(DRFLAC_CACHE_L1_SELECT((bs), (_bitCount)) >> (DRFLAC_CACHE_L1_SELECTION_SHIFT((bs), (_bitCount)) & (DRFLAC_CACHE_L1_SIZE_BITS(bs)-1)))
814+
#define DRFLAC_CACHE_L2_SIZE_BYTES(bs) (sizeof((bs)->cacheL2))
815+
#define DRFLAC_CACHE_L2_LINE_COUNT(bs) (DRFLAC_CACHE_L2_SIZE_BYTES(bs) / sizeof((bs)->cacheL2[0]))
816+
#define DRFLAC_CACHE_L2_LINES_REMAINING(bs) (DRFLAC_CACHE_L2_LINE_COUNT(bs) - (bs)->nextL2Line)
817+
817818
#ifdef __cplusplus
818819
}
819820
#endif
820-
821-
#endif /* DR_FLAC_H */
821+
#endif /* dr_flac_h */

griffin/griffin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1415,6 +1415,7 @@ MENU
14151415
DEPENDENCIES
14161416
============================================================ */
14171417
#ifdef HAVE_FLAC
1418+
#include "../deps/dr/dr_flac.c"
14181419
#include "../deps/libFLAC/bitmath.c"
14191420
#include "../deps/libFLAC/bitreader.c"
14201421
#include "../deps/libFLAC/cpu.c"
@@ -1458,7 +1459,6 @@ DEPENDENCIES
14581459
#include "../libretro-common/formats/libchdr/libchdr_huffman.c"
14591460

14601461
#ifdef HAVE_FLAC
1461-
#include "../deps/dr/dr_flac.c"
14621462
#include "../libretro-common/formats/libchdr/libchdr_flac.c"
14631463
#include "../libretro-common/formats/libchdr/libchdr_flac_codec.c"
14641464
#endif

0 commit comments

Comments
 (0)