summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2011-03-13 19:59:27 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2011-03-13 19:59:27 +0000
commit8aed244bd8b05e7cc0a61846b3cb82e936f18494 (patch)
tree78333ad1341a5efaa75d81c04885a4c02ded1216
parentff1b2b7fab5bbfa9f81173cdb77a34f08231d0d9 (diff)
downloadrockbox-8aed244bd8b05e7cc0a61846b3cb82e936f18494.tar.gz
rockbox-8aed244bd8b05e7cc0a61846b3cb82e936f18494.zip
Add up skipped bytes when parsing for valid MPEG headers.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29583 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/mp3data.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/mp3data.c b/apps/mp3data.c
index 35b4608396..bb42c94fc6 100644
--- a/apps/mp3data.c
+++ b/apps/mp3data.c
@@ -448,12 +448,16 @@ static void get_vbri_info(struct mp3info *info, unsigned char *buf)
448/* Seek to next mpeg header and extract relevant information. */ 448/* Seek to next mpeg header and extract relevant information. */
449static int get_next_header_info(int fd, long *bytecount, struct mp3info *info) 449static int get_next_header_info(int fd, long *bytecount, struct mp3info *info)
450{ 450{
451 unsigned long header = find_next_frame(fd, bytecount, 0x20000, 0); 451 long tmp;
452 unsigned long header = find_next_frame(fd, &tmp, 0x20000, 0);
452 if(header == 0) 453 if(header == 0)
453 return -1; 454 return -1;
454 455
455 if(!mp3headerinfo(info, header)) 456 if(!mp3headerinfo(info, header))
456 return -2; 457 return -2;
458
459 /* Next header is tmp bytes away. */
460 *bytecount += tmp;
457 461
458 return 0; 462 return 0;
459} 463}
@@ -461,7 +465,7 @@ static int get_next_header_info(int fd, long *bytecount, struct mp3info *info)
461int get_mp3file_info(int fd, struct mp3info *info) 465int get_mp3file_info(int fd, struct mp3info *info)
462{ 466{
463 unsigned char frame[1800], *vbrheader; 467 unsigned char frame[1800], *vbrheader;
464 long bytecount; 468 long bytecount = 0;
465 int result; 469 int result;
466 470
467 /* Initialize info and frame */ 471 /* Initialize info and frame */