diff options
author | Daniel Stenberg <daniel@haxx.se> | 2003-05-19 14:15:21 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2003-05-19 14:15:21 +0000 |
commit | 24756e1cf77cf02aa427357e3f0d4562972952e6 (patch) | |
tree | 8eced4bec5451b9cd5df0f546653d0e48e54df98 /firmware/mp3data.c | |
parent | 644c6695190ae4427d8337f6c7acb0bb70eea8cf (diff) | |
download | rockbox-24756e1cf77cf02aa427357e3f0d4562972952e6.tar.gz rockbox-24756e1cf77cf02aa427357e3f0d4562972952e6.zip |
Stevie Oh's patch #739898 that corrects how vbrfix works on large files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3685 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/mp3data.c')
-rw-r--r-- | firmware/mp3data.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/firmware/mp3data.c b/firmware/mp3data.c index 5baa9ec149..38fae384e0 100644 --- a/firmware/mp3data.c +++ b/firmware/mp3data.c | |||
@@ -646,7 +646,23 @@ int create_xing_header(int fd, int startpos, int filesize, | |||
646 | } | 646 | } |
647 | 647 | ||
648 | /* Fill in the TOC entry */ | 648 | /* Fill in the TOC entry */ |
649 | toc[i] = filepos * 256 / filesize; | 649 | /* each toc is a single byte indicating how many 256ths of the |
650 | * way through the file, is that percent of the way through the | ||
651 | * song. the easy method, filepos*256/filesize, chokes when | ||
652 | * the upper 8 bits of the file position are nonzero | ||
653 | * (i.e. files over 16mb in size). | ||
654 | */ | ||
655 | if (filepos > 0xFFFFFF) | ||
656 | { | ||
657 | /* instead of multiplying filepos by 256, we divide | ||
658 | * filesize by 256. | ||
659 | */ | ||
660 | toc[i] = filepos / (filesize >> 8); | ||
661 | } | ||
662 | else | ||
663 | { | ||
664 | toc[i] = filepos * 256 / filesize; | ||
665 | } | ||
650 | 666 | ||
651 | DEBUGF("Pos %d: %d relpos: %d filepos: %x tocentry: %x\n", | 667 | DEBUGF("Pos %d: %d relpos: %d filepos: %x tocentry: %x\n", |
652 | i, pos, pos-last_pos, filepos, toc[i]); | 668 | i, pos, pos-last_pos, filepos, toc[i]); |