mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix system wavpack (fixes #1041)
This commit is contained in:
parent
47a99c7dab
commit
295b8a663a
|
@ -881,12 +881,12 @@ if(CLIENT)
|
|||
|
||||
set(CMAKE_REQUIRED_INCLUDES ${ORIGINAL_CMAKE_REQUIRED_INCLUDES} ${WAVPACK_INCLUDE_DIRS})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${ORIGINAL_CMAKE_REQUIRED_LIBRARIES} ${WAVPACK_LIBRARIES})
|
||||
check_symbol_exists(WavpackOpenFileInputEx wavpack.h WAVPACK_OPEN_FILE_INPUT_EX)
|
||||
check_symbol_exists(WavpackOpenFileInputEx64 wavpack.h WAVPACK_OPEN_FILE_INPUT_EX64)
|
||||
set(CMAKE_REQUIRED_INCLUDES ${ORIGINAL_CMAKE_REQUIRED_INCLUDES})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${ORIGINAL_CMAKE_REQUIRED_LIBRARIES})
|
||||
|
||||
if(WAVPACK_OPEN_FILE_INPUT_EX)
|
||||
target_compile_definitions(${TARGET_CLIENT} PRIVATE CONF_WAVPACK_OPEN_FILE_INPUT_EX)
|
||||
if(WAVPACK_OPEN_FILE_INPUT_EX64)
|
||||
target_compile_definitions(${TARGET_CLIENT} PRIVATE CONF_WAVPACK_OPEN_FILE_INPUT_EX64)
|
||||
endif()
|
||||
|
||||
list(APPEND TARGETS_OWN ${TARGET_CLIENT})
|
||||
|
|
|
@ -469,7 +469,7 @@ static int ReadDataOld(void *pBuffer, int Size)
|
|||
return ChunkSize;
|
||||
}
|
||||
|
||||
#if defined(CONF_WAVPACK_OPEN_FILE_INPUT_EX)
|
||||
#if defined(CONF_WAVPACK_OPEN_FILE_INPUT_EX64)
|
||||
static int ReadData(void *pId, void *pBuffer, int Size)
|
||||
{
|
||||
(void)pId;
|
||||
|
@ -482,13 +482,13 @@ static int ReturnFalse(void *pId)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static unsigned int GetPos(void *pId)
|
||||
static int64_t GetPos(void *pId)
|
||||
{
|
||||
(void)pId;
|
||||
return s_WVBufferPosition;
|
||||
}
|
||||
|
||||
static unsigned int GetLength(void *pId)
|
||||
static int64_t GetLength(void *pId)
|
||||
{
|
||||
(void)pId;
|
||||
return s_WVBufferSize;
|
||||
|
@ -514,14 +514,14 @@ int CSound::DecodeWV(int SampleID, const void *pData, unsigned DataSize)
|
|||
s_WVBufferSize = DataSize;
|
||||
s_WVBufferPosition = 0;
|
||||
|
||||
#if defined(CONF_WAVPACK_OPEN_FILE_INPUT_EX)
|
||||
WavpackStreamReader Callback = {0};
|
||||
#if defined(CONF_WAVPACK_OPEN_FILE_INPUT_EX64)
|
||||
WavpackStreamReader64 Callback = {0};
|
||||
Callback.can_seek = ReturnFalse;
|
||||
Callback.get_length = GetLength;
|
||||
Callback.get_pos = GetPos;
|
||||
Callback.push_back_byte = PushBackByte;
|
||||
Callback.read_bytes = ReadData;
|
||||
pContext = WavpackOpenFileInputEx(&Callback,0, 0, aError, 0, 0);
|
||||
Callback.read_bytes = ::ReadData;
|
||||
pContext = WavpackOpenFileInputEx64(&Callback,0, 0, aError, 0, 0);
|
||||
#else
|
||||
pContext = WavpackOpenFileInput(ReadDataOld, aError);
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue