From f0899de958d42cdfb12a1650286777deaf3f4636 Mon Sep 17 00:00:00 2001 From: zemar1325 <165853725+zemar1325@users.noreply.github.com> Date: Sat, 19 Oct 2024 15:02:46 -0700 Subject: [PATCH] S24: change storage to 4 chars This is required (at least on my system (aarch64, gcc 14.1.1)) because the convertBuffer function is expecting arrays of S24 to increment at the same rate as arrays of S32; without this change, when a S24* pointer increments, it increases by 3 instead of 4 on my system, causing garbled audio output. Since this very minor change is an interface change, I have bumped the version number. --- RtAudio.cpp | 4 +--- RtAudio.h | 2 +- configure.ac | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/RtAudio.cpp b/RtAudio.cpp index ac6bee92..4a33e9a9 100644 --- a/RtAudio.cpp +++ b/RtAudio.cpp @@ -10911,12 +10911,10 @@ unsigned int RtApi :: formatBytes( RtAudioFormat format ) { if ( format == RTAUDIO_SINT16 ) return 2; - else if ( format == RTAUDIO_SINT32 || format == RTAUDIO_FLOAT32 ) + else if ( format == RTAUDIO_SINT32 || format == RTAUDIO_FLOAT32 || format == RTAUDIO_SINT24) return 4; else if ( format == RTAUDIO_FLOAT64 ) return 8; - else if ( format == RTAUDIO_SINT24 ) - return 3; else if ( format == RTAUDIO_SINT8 ) return 1; diff --git a/RtAudio.h b/RtAudio.h index e767ddb2..17fb5bdc 100644 --- a/RtAudio.h +++ b/RtAudio.h @@ -711,7 +711,7 @@ struct CallbackInfo { class S24 { protected: - unsigned char c3[3]; + unsigned char c3[4]; public: S24() {} diff --git a/configure.ac b/configure.ac index 67dca684..35f9d996 100644 --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,7 @@ AM_INIT_AUTOMAKE([1.14 -Wall -Werror foreign subdir-objects]) # # If any interfaces have been removed since the last public release, then set # age to 0. -m4_define([lt_current], 7) +m4_define([lt_current], 8) m4_define([lt_revision], 0) m4_define([lt_age], 0)