Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Codecs: mp4: metadata: Fix time length in very large files

Fix 40 hours long book reported as 14 hours due to samples overflow

Change-Id: I5988d4492b1f51081fff921180de6fe384ab5f4f

authored by

roman.artiukhin and committed by
Solomon Peachy
d2f7777f df51d49b

+4 -6
+1 -1
lib/rbcodec/metadata/metadata.h
··· 259 259 int tail_trim; /* Number of samples to remove from the end */ 260 260 261 261 /* Added for Vorbis, used by mp4 parser as well. */ 262 - unsigned long samples; /* number of samples in track */ 262 + uint64_t samples; /* number of samples in track */ 263 263 264 264 /* MP3 stream specific info */ 265 265 unsigned long frame_count; /* number of frames in the file (if VBR) */
+3 -5
lib/rbcodec/metadata/mp4.c
··· 707 707 * need any further special handling. */ 708 708 if (id3->codectype==AFMT_MP4_AAC_HE && l<=1024) 709 709 { 710 - id3->samples += n * l * 2; 710 + l *= 2; 711 711 id3->needs_upsampling_correction = true; 712 712 } 713 - else 714 - { 715 - id3->samples += n * l; 716 - } 713 + 714 + id3->samples += (uint64_t) n * l; 717 715 } 718 716 719 717 size = 0;