Skip to content

Commit acffeb1

Browse files
committed
vorbis: Patched to compile when using libvorbisidec ("Tremor").
Fixes #702.
1 parent b0ab4cf commit acffeb1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,14 @@ cmake_dependent_option(SDLMIXER_OPUS_SHARED "Dynamically load libopus" "${SDLMIX
156156

157157
option(SDLMIXER_VORBIS_STB "Enable Ogg Vorbis audio via stb_vorbis" ON)
158158
option(SDLMIXER_VORBIS_VORBISFILE "Enable Ogg Vorbis audio via libvorbisfile" ON)
159-
option(SDLMIXER_VORBIS_TREMOR "Enable Ogg Vorbis audio via libtremor" OFF)
159+
option(SDLMIXER_VORBIS_TREMOR "Enable Ogg Vorbis audio via libvorbisidec ('tremor')" OFF)
160160

161161
if (SDLMIXER_VORBIS_VORBISFILE AND SDLMIXER_VORBIS_TREMOR)
162162
message(FATAL_ERROR "Both SDLMIXER_VORBIS_VORBISFILE and SDLMIXER_VORBIS_TREMOR are both enabled, but only one can be used")
163163
endif()
164164

165165
cmake_dependent_option(SDLMIXER_VORBIS_VORBISFILE_SHARED "Dynamically load vorbisfile library" "${SDLMIXER_DEPS_SHARED}" SDLMIXER_VORBIS_VORBISFILE OFF)
166-
cmake_dependent_option(SDLMIXER_VORBIS_TREMOR_SHARED "Dynamically load tremor library" "${SDLMIXER_DEPS_SHARED}" SDLMIXER_VORBIS_TREMOR OFF)
166+
cmake_dependent_option(SDLMIXER_VORBIS_TREMOR_SHARED "Dynamically load vorbisidec ('tremor') library" "${SDLMIXER_DEPS_SHARED}" SDLMIXER_VORBIS_TREMOR OFF)
167167

168168
option(SDLMIXER_WAVPACK "Enable WavPack audio" ON)
169169
cmake_dependent_option(SDLMIXER_WAVPACK_DSD "Enable WavPack DSD audio support" OFF SDLMIXER_WAVPACK OFF)
@@ -325,7 +325,7 @@ set(PC_REQUIRES)
325325
set(SDLMIXER_BACKENDS)
326326

327327
if(SDLMIXER_OGG)
328-
# libogg is a requirement of libflac, libtremor and libvorbisfile, so only need this library when vendoring
328+
# libogg is a requirement of libflac, libvorbisidec and libvorbisfile, so only need this library when vendoring
329329
if(SDLMIXER_VENDORED)
330330
message(STATUS "Using vendored libogg")
331331
set(BUILD_SHARED_LIBS ${SDLMIXER_OGG_SHARED})
@@ -454,7 +454,7 @@ if(SDLMIXER_VORBIS_TREMOR)
454454
find_package(tremor ${required})
455455
if(tremor_FOUND)
456456
if(NOT SDLMIXER_VORBIS_TREMOR_SHARED)
457-
list(APPEND PC_REQUIRES tremor)
457+
list(APPEND PC_REQUIRES vorbisidec)
458458
endif()
459459
set(SDLMIXER_VORBIS_TREMOR_ENABLED TRUE)
460460
else()

src/decoder_vorbis.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ static bool SDLCALL VORBIS_decode(void *track_userdata, SDL_AudioStream *stream)
246246
int bitstream = tdata->current_bitstream;
247247

248248
#ifdef VORBIS_USE_TREMOR
249-
const size_t framesize = adata->framesize;
249+
const size_t framesize = tdata->adata->framesize;
250250
Uint8 samples[256];
251-
const int amount = (int)vorbis.ov_read(&tdata->vf, samples, sizeof (samples), &bitstream);
251+
int amount = (int)vorbis.ov_read(&tdata->vf, (char *) samples, sizeof (samples), &bitstream);
252252
if (amount < 0) {
253253
return SetOggVorbisError("ov_read", amount);
254254
}

0 commit comments

Comments
 (0)