From 6ea12950de030fba52de5e5218fd35e90463968b Mon Sep 17 00:00:00 2001 From: Stefano D'Angelo Date: Sun, 28 Jan 2024 12:20:01 +0100 Subject: [PATCH] probably fixed some audio bug --- templates/android-make/.Makefile.swp | Bin 12288 -> 0 bytes templates/android/src/jni.cpp | 8 ++++++-- 2 files changed, 6 insertions(+), 2 deletions(-) delete mode 100644 templates/android-make/.Makefile.swp diff --git a/templates/android-make/.Makefile.swp b/templates/android-make/.Makefile.swp deleted file mode 100644 index 0c3efed7e262d7107c5fe4403a2986e58226b298..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2OKclO7{{j++J?7yNj)H@!J@H}^(Jj8A*j%e?Y7(c5!rdQK)2)FvAywnz3i@| zgkU&w;&I@>OXbuXaH%L)H~<%r5aNKiAc5e>?7GGCOmGH*6Obw&wTUEH~*P$ zW~**va#1bQ$8%EzpSuY;GuyVm|j|W*ctLG^8%;aJh`Xnx@5vxJj#01yTk6s{(z$DNWx& zjvkqs6kQ)4Jw)%lXW_qkN$pbwQUy{4QUy{4QUy{4QUy{4QUz{c1$<`@c?t2~6wTpc z^u1@>cl0y;N)<>INEJvGNEJvGNEJvGNEJvGNEJvGNEJvGxB(Sl1|f@k3Hjw_1dsp! zkN^Gu`(1?m2EGNKgHOR#@Bw%qTn3Xs2K&GdcM|dmxB}L}8nD3}^@G{r{D?kSqKouz9Q7{G`1P8#Mw-NFy_zC<7 zz5rLj2jG41DtHAb;H_H;c@vbt6qp1rj}Y#Ni*-mpsRF42|4V_~+?i_S{0wE5 zMRkiao0>LWOd47X8$w1h8%kkz5SWQhnTurPX)4)t^itH~wK?jYF11Y0rw-FQti?V0 z0&U?vCVDZdn8|FMRTdR(PRXBBP8YR`QZ5cIjnZf7BahI?Q{NWB1fvWweuDBf)2EXp zGMb@{zG)e9W@C1tQYb|(bIj==YPUNwoj9BrGp-HB%*vUuz&aa_cQ{KWscYI2b4;jQRx6q^r(&*BukSm3Oz`6Eb3>$kGUCKU zw%q)ytoZv`MB!{t@XbX*c!4w*)H$W3o~~diAd5qfU3WkXnFOhN_5Be1v)u_@R9L7RgG!6JGdj_05c@}nL$ zqF1t2c#YeT6wLvq?sxqmhoEppwP9 zreP9n#pmc)X5)-f*UD-^)zr#hg06Ef3ngI`?paZ^dM)~lDBxUdxy)&sx))U7V)9L0 z!a?f!hCV(XR<@bT4HV-sXHG=M#tGO=O~KQW!wqJmZ_u*D*L;_SMRC)Kv8qRdufpt- zR;g-*;_Sldu%fb6ZqBKBRL1uM4F-y5936RL#>rDNlUd>o#c@>I=WdhfJd-IyjRIda zb)LuQ4P4g$)MILQ@pc`Lj3k>y_~FSPMW4I}L{)sBXgHzZgVt)oUaoCkOY!R*A##QghmbKcI9hZyq)W?}@_t&Jg>Eqh* zV{*f^#lse!vyf<_KFUn-^tE*{i)RqKH9k&)XA+Djo(}Xl|D)?$=y>Ef;g-iqvg+|& T_p@p1R^Q-smAPK7+aZ4ejFH$g diff --git a/templates/android/src/jni.cpp b/templates/android/src/jni.cpp index 7fb4c44..169ad63 100644 --- a/templates/android/src/jni.cpp +++ b/templates/android/src/jni.cpp @@ -104,11 +104,16 @@ static void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, const float * in_buf = reinterpret_cast(pInput); float * out_buf = reinterpret_cast(pOutput); ma_uint32 i = 0; +#if NUM_CHANNELS_IN > 0 + size_t ix = 0; +#endif +#if NUM_CHANNELS_OUT > 0 + size_t iy = 0; +#endif while (i < frameCount) { ma_uint32 n = std::min(frameCount - i, static_cast(BLOCK_SIZE)); #if NUM_CHANNELS_IN > 0 - size_t ix = NUM_CHANNELS_IN * i; for (ma_uint32 j = 0; j < n; j++) for (size_t k = 0; k < NUM_CHANNELS_IN; k++, ix++) x_buf[BLOCK_SIZE * k + j] = in_buf[ix]; @@ -121,7 +126,6 @@ static void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, plugin_process(&instance, x, y, n); #if NUM_CHANNELS_OUT > 0 - size_t iy = NUM_CHANNELS_OUT * i; for (ma_uint32 j = 0; j < n; j++) for (size_t k = 0; k < NUM_CHANNELS_OUT; k++, iy++) out_buf[iy] = y_buf[BLOCK_SIZE * k + j];