Skip to content

Commit a854a76

Browse files
committed
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!
1 parent 6c3d555 commit a854a76

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

shared-module/audiocore/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ uint8_t audiosample_channel_count(mp_obj_t sample_obj) {
5252

5353
void audiosample_reset_buffer(mp_obj_t sample_obj, bool single_channel, uint8_t audio_channel) {
5454
const audiosample_p_t *proto = mp_proto_get_or_throw(MP_QSTR_protocol_audiosample, sample_obj);
55-
proto->reset_buffer(MP_OBJ_TO_PTR(sample_obj));
55+
proto->reset_buffer(MP_OBJ_TO_PTR(sample_obj), single_channel, audio_channel);
5656
}
5757

5858
audioio_get_buffer_result_t audiosample_get_buffer(mp_obj_t sample_obj,

shared-module/audiocore/__init__.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ typedef enum {
4242
typedef uint32_t (*audiosample_sample_rate_fun)(mp_obj_t);
4343
typedef uint8_t (*audiosample_bits_per_sample_fun)(mp_obj_t);
4444
typedef uint8_t (*audiosample_channel_count_fun)(mp_obj_t);
45-
typedef void (*audiosample_reset_buffer_fun)(mp_obj_t);
45+
typedef void (*audiosample_reset_buffer_fun)(mp_obj_t,
46+
bool single_channel, uint8_t audio_channel);
4647
typedef audioio_get_buffer_result_t (*audiosample_get_buffer_fun)(mp_obj_t,
4748
bool single_channel, uint8_t channel, uint8_t** buffer,
4849
uint32_t* buffer_length);

0 commit comments

Comments
 (0)