A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

Codecs: mp3: Move strip tags to codec

Another fix for FS#13626 (replacement for 2bd88936f78903f1f84d4f0480d92af1327df7ba)

Change-Id: Ife5f65539457559fd908d0048d4df94649b0b894

authored by

Roman Artiukhin and committed by
Solomon Peachy
38105860 78903e9d

+24
+10
apps/buffering.c
··· 1408 1408 return size; 1409 1409 } 1410 1410 1411 + off_t bufstripsize(int handle_id, off_t size) 1412 + { 1413 + struct memory_handle *h = find_handle(handle_id); 1414 + if (!h || h->filesize < size) 1415 + return ERR_INVALID_VALUE; 1416 + 1417 + h->filesize = size; 1418 + return size; 1419 + } 1420 + 1411 1421 /* Update the "data" pointer to make the handle's data available to the caller. 1412 1422 Return the length of the available linear data or < 0 for failure (handle 1413 1423 not found).
+1
apps/buffering.h
··· 81 81 int bufadvance(int handle_id, off_t offset); 82 82 off_t bufftell(int handle_id); 83 83 ssize_t bufread(int handle_id, size_t size, void *dest); 84 + off_t bufstripsize(int handle_id, off_t size); 84 85 ssize_t bufgetdata(int handle_id, size_t size, void **data); 85 86 86 87 /***************************************************************************
+6
apps/codec_thread.c
··· 440 440 return global_settings.repeat_mode == REPEAT_ONE; 441 441 } 442 442 443 + void codec_strip_filesize_callback(off_t size) 444 + { 445 + if (bufstripsize(ci.audio_hid, size) >= 0) 446 + ci.filesize = size; 447 + } 443 448 444 449 /** --- CODEC THREAD --- **/ 445 450 ··· 647 652 ci.configure = codec_configure_callback; 648 653 ci.get_command = codec_get_command_callback; 649 654 ci.loop_track = codec_loop_track_callback; 655 + ci.strip_filesize = codec_strip_filesize_callback; 650 656 651 657 /* Init threading */ 652 658 queue_init(&codec_queue, false);
+1
apps/codecs.c
··· 89 89 NULL, /* configure */ 90 90 NULL, /* get_command */ 91 91 NULL, /* loop_track */ 92 + NULL, /* strip_filesize */ 92 93 93 94 /* kernel/ system */ 94 95 #if defined(ARM_NEED_DIV0)
+1
lib/rbcodec/codecs/codecs.h
··· 152 152 long (*get_command)(intptr_t *param); 153 153 /* Determine whether the track should be looped, if applicable. */ 154 154 bool (*loop_track)(void); 155 + void (*strip_filesize)(off_t value); 155 156 156 157 /* kernel/ system */ 157 158 #if defined(ARM_NEED_DIV0)
+5
lib/rbcodec/codecs/mpa.c
··· 448 448 ci->configure(DSP_SET_FREQUENCY, ci->id3->frequency); 449 449 current_frequency = ci->id3->frequency; 450 450 codec_set_replaygain(ci->id3); 451 + if (!ci->id3->is_asf_stream) 452 + { 453 + // End of file might contain ID3v1 or APE tags. Strip them from decoding 454 + ci->strip_filesize(ci->id3->first_frame_offset + ci->id3->filesize); 455 + } 451 456 452 457 if (ci->id3->offset) { 453 458