summaryrefslogtreecommitdiff
path: root/shared-module/audiocore
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2019-12-13 14:05:56 -0600
committerJeff Epler <jepler@gmail.com>2019-12-13 18:31:12 -0600
commita854a76819e4b871f9d0c4e059ca5c03f05dca76 (patch)
tree1b650eb2ebaa2881a169db4526e5c872a3180d9d /shared-module/audiocore
parent6c3d555b873fb7dddfa09ff24c6630c1aae47d3d (diff)
audiocore: The arguments to reset_buffer went missing
In conversion I missed these arguments were being passed, but noticed it when an implausible value for audio_channel was sent to mp3's reset_buffer method. It's not clear whether there was any negative impact to this, but it should be fixed!
Diffstat (limited to 'shared-module/audiocore')
-rw-r--r--shared-module/audiocore/__init__.c2
-rw-r--r--shared-module/audiocore/__init__.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/shared-module/audiocore/__init__.c b/shared-module/audiocore/__init__.c
index 1553dbe96..ac9d41b60 100644
--- a/shared-module/audiocore/__init__.c
+++ b/shared-module/audiocore/__init__.c
@@ -52,7 +52,7 @@ uint8_t audiosample_channel_count(mp_obj_t sample_obj) {
void audiosample_reset_buffer(mp_obj_t sample_obj, bool single_channel, uint8_t audio_channel) {
const audiosample_p_t *proto = mp_proto_get_or_throw(MP_QSTR_protocol_audiosample, sample_obj);
- proto->reset_buffer(MP_OBJ_TO_PTR(sample_obj));
+ proto->reset_buffer(MP_OBJ_TO_PTR(sample_obj), single_channel, audio_channel);
}
audioio_get_buffer_result_t audiosample_get_buffer(mp_obj_t sample_obj,
diff --git a/shared-module/audiocore/__init__.h b/shared-module/audiocore/__init__.h
index 38c1f5aeb..7a56454b8 100644
--- a/shared-module/audiocore/__init__.h
+++ b/shared-module/audiocore/__init__.h
@@ -42,7 +42,8 @@ typedef enum {
typedef uint32_t (*audiosample_sample_rate_fun)(mp_obj_t);
typedef uint8_t (*audiosample_bits_per_sample_fun)(mp_obj_t);
typedef uint8_t (*audiosample_channel_count_fun)(mp_obj_t);
-typedef void (*audiosample_reset_buffer_fun)(mp_obj_t);
+typedef void (*audiosample_reset_buffer_fun)(mp_obj_t,
+ bool single_channel, uint8_t audio_channel);
typedef audioio_get_buffer_result_t (*audiosample_get_buffer_fun)(mp_obj_t,
bool single_channel, uint8_t channel, uint8_t** buffer,
uint32_t* buffer_length);