diff options
-rw-r--r-- | firmware/id3.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/firmware/id3.c b/firmware/id3.c index 8240e0d846..f1aa821fba 100644 --- a/firmware/id3.c +++ b/firmware/id3.c | |||
@@ -906,17 +906,16 @@ static int getsonglength(int fd, struct mp3entry *entry) | |||
906 | 906 | ||
907 | if(filetime == 0) | 907 | if(filetime == 0) |
908 | { | 908 | { |
909 | /* | 909 | filetime = (entry->filesize - bytecount) / (info.bitrate / 8); |
910 | * Now song length is | 910 | /* bitrate is in kbps so this delivers milliseconds. Doing bitrate / 8 |
911 | * ((filesize)/(bytes per frame))*(time per frame) | 911 | * instead of filesize * 8 is exact, because mpeg audio bitrates are |
912 | */ | 912 | * always multiples of 8, and it avoids overflows. */ |
913 | filetime = entry->filesize/info.frame_size*info.frame_time; | ||
914 | } | 913 | } |
915 | 914 | ||
916 | entry->tpf = info.frame_time; | 915 | entry->tpf = info.frame_time; |
917 | entry->bpf = info.frame_size; | 916 | entry->bpf = info.frame_size; |
918 | entry->frame_count = info.frame_count; | 917 | entry->frame_count = info.frame_count; |
919 | 918 | ||
920 | entry->vbr = info.is_vbr; | 919 | entry->vbr = info.is_vbr; |
921 | entry->has_toc = info.has_toc; | 920 | entry->has_toc = info.has_toc; |
922 | 921 | ||