Skip to content

Commit 6f6b680

Browse files
committed
MP3Decoder: improve some comments
1 parent 4465f85 commit 6f6b680

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

shared-module/audiomp3/MP3Decoder.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ static bool stream_readable(void *stream) {
4646
return ret != 0;
4747
}
4848

49-
// (near copy of mp_stream_posix_read, but with changes)
50-
// (circuitpy doesn't enable posix stream routines anyway)
49+
// This is a near copy of mp_stream_posix_read, but avoiding use of global
50+
// errno value & with added prints for debugging purposes. (circuitpython doesn't
51+
// enable mp_stream_posix_read anyway)
5152
static mp_int_t stream_read(void *stream, void *buf, size_t len) {
5253
int errcode;
5354
mp_obj_base_t *o = MP_OBJ_TO_PTR(stream);
@@ -69,8 +70,8 @@ static mp_int_t stream_read(void *stream, void *buf, size_t len) {
6970
}
7071
}
7172

72-
// (near copy of mp_stream_posix_lseek, but with changes)
73-
// (circuitpy doesn't enable posix stream routines anyway)
73+
// This is a near copy of mp_stream_posix_lseek, but avoiding use of global
74+
// errno value (circuitpython doesn't enable posix stream routines anyway)
7475
static off_t stream_lseek(void *stream, off_t offset, int whence) {
7576
int errcode;
7677
const mp_obj_base_t *o = stream;
@@ -267,7 +268,7 @@ void common_hal_audiomp3_mp3file_construct(audiomp3_mp3file_obj_t *self,
267268
mp_obj_t stream,
268269
uint8_t *buffer,
269270
size_t buffer_size) {
270-
// XXX Adafruit_MP3 uses a 2kB input buffer and two 4kB output pcm_buffer.
271+
// Note: Adafruit_MP3 uses a 2kB input buffer and two 4kB output pcm_buffer.
271272
// for a whopping total of 10kB pcm_buffer (+mp3 decoder state and frame buffer)
272273
// At 44kHz, that's 23ms of output audio data.
273274
//

0 commit comments

Comments
 (0)