diff --git a/apps/codecs/libmusepack/mpc_decoder.c b/apps/codecs/libmusepack/mpc_decoder.c index f8fdd8889e..024e7ab2c2 100644 --- a/apps/codecs/libmusepack/mpc_decoder.c +++ b/apps/codecs/libmusepack/mpc_decoder.c @@ -269,11 +269,15 @@ mpc_decoder_huffman_decode_faster(mpc_decoder *d, const HuffmanTyp* Table) return Table->Value; } +MPC_SAMPLE_FORMAT V_L[MPC_V_MEM + 960] IBSS_ATTR; +MPC_SAMPLE_FORMAT V_R[MPC_V_MEM + 960] IBSS_ATTR; + static void mpc_decoder_reset_v(mpc_decoder *d) { - memset(d->V_L, 0, sizeof d->V_L); - memset(d->V_R, 0, sizeof d->V_R); + /* since d->V_L and d->V_R are now pointers, sizeof (d->V_x) will no longer work */ + memset(d->V_L, 0, sizeof V_L); + memset(d->V_R, 0, sizeof V_R); } static void @@ -1106,9 +1110,6 @@ mpc_decoder_read_bitstream_sv7(mpc_decoder *d) } } -MPC_SAMPLE_FORMAT V_L[MPC_V_MEM + 960] IBSS_ATTR; -MPC_SAMPLE_FORMAT V_R[MPC_V_MEM + 960] IBSS_ATTR; - void mpc_decoder_setup(mpc_decoder *d, mpc_reader *r) { d->r = r; diff --git a/apps/codecs/mpc.c b/apps/codecs/mpc.c index 2d2aa6ed66..db2501525e 100644 --- a/apps/codecs/mpc.c +++ b/apps/codecs/mpc.c @@ -81,6 +81,10 @@ enum codec_status codec_start(struct codec_api *api) mpc_streaminfo info; TEST_CODEC_API(api); + #ifdef USE_IRAM + ci->memcpy(iramstart, iramcopy, iramend - iramstart); + #endif + ci->configure(CODEC_DSP_ENABLE, (bool *)true); ci->configure(DSP_DITHER, (bool *)false); @@ -103,10 +107,6 @@ enum codec_status codec_start(struct codec_api *api) reader.data = ci; next_track: - #ifdef USE_IRAM - ci->memcpy(iramstart, iramcopy, iramend - iramstart); - #endif - if (codec_init(api)) return CODEC_ERROR;