diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2021-03-01 14:00:16 -0500 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2021-03-01 19:02:22 +0000 |
commit | 7418ec5009a0203b562bcf128713ef741815fe0e (patch) | |
tree | 93e523ca8aaaac8d60fd69cf406c79ba1272e918 | |
parent | 640b14c08ccc885817cc697bfd1cde24479b8126 (diff) | |
download | rockbox-7418ec5009.tar.gz rockbox-7418ec5009.zip |
FS#13267: Fix crash when enabling Perceptual Bass Enhancment during playback
I think the assumption is that during playback, the DSP is already running
so it assumes PBE needs to be flushed before it is properly enabled.
Change-Id: I2bac3d02c80f97c8d9ce26a575175f6344a8e86a
-rw-r--r-- | lib/rbcodec/dsp/pbe.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/rbcodec/dsp/pbe.c b/lib/rbcodec/dsp/pbe.c index 8fb893a661..634849d91c 100644 --- a/lib/rbcodec/dsp/pbe.c +++ b/lib/rbcodec/dsp/pbe.c @@ -64,6 +64,9 @@ static void pbe_buffer_free(void) static void dsp_pbe_flush(void) { + if (handle < 0) + return; + memset(core_get_data(handle), 0, PBE_BUFSIZE); b0_r[0] = 0; b0_w[0] = 0; @@ -142,6 +145,9 @@ static void pbe_process(struct dsp_proc_entry *this, int32_t *b0[2], *b2[2], *b3[2]; + if (handle < 0) + return; + b0[0] = core_get_data(handle); b0[1] = b0[0] + B0_SIZE; b2[0] = b0[1] + B0_SIZE; |