diff options
| author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-03-17 18:13:14 +0000 |
|---|---|---|
| committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-03-17 18:13:14 +0000 |
| commit | c59a086da6ef1e768b53d7cfb5e55ba41cb68f89 (patch) | |
| tree | 98e0afdf95a0389a6f905e90bbb77b43f369222d /apps/mp3data.c | |
| parent | c1a5b6649941e2bcb470e0f4532ea2f69cc48593 (diff) | |
| download | rockbox-c59a086da6ef1e768b53d7cfb5e55ba41cb68f89.zip rockbox-c59a086da6ef1e768b53d7cfb5e55ba41cb68f89.tar.gz rockbox-c59a086da6ef1e768b53d7cfb5e55ba41cb68f89.tar.bz2 rockbox-c59a086da6ef1e768b53d7cfb5e55ba41cb68f89.tar.xz | |
Local implementation of read_uint32be() in mp3data.c needs a major correction.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29609 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/mp3data.c')
| -rw-r--r-- | apps/mp3data.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/apps/mp3data.c b/apps/mp3data.c index 90362e3..aa54761 100644 --- a/apps/mp3data.c +++ b/apps/mp3data.c @@ -39,7 +39,7 @@ #include "mp3data.h" #include "file.h" #include "buffer.h" -#include "metadata/metadata_common.h" +#include "system.h" // #define DEBUG_VERBOSE @@ -214,16 +214,14 @@ static bool headers_have_same_type(unsigned long header1, } /* Helper function to read 4-byte in big endian format. */ -static void read_uint32be_mp3data(int fd, unsigned long *data, long *pos) +static void read_uint32be_mp3data(int fd, unsigned long *data) { #ifdef ROCKBOX_BIG_ENDIAN (void)read(fd, (char*)data, 4); #else - char tmp[4]; - (void)read(fd, tmp, 4); - *data = (tmp[0]<<24) | (tmp[1]<<16) | (tmp[2]<<8) | tmp[3]; + (void)read(fd, (char*)data, 4); + *data = betoh32(*data); #endif - *pos += 4; } static unsigned long __find_next_frame(int fd, long *offset, long max_offset, @@ -272,7 +270,7 @@ static unsigned long __find_next_frame(int fd, long *offset, long max_offset, /* Read possible next frame header and seek back to last frame * headers byte position. */ reference_header = 0; - read_uint32be_mp3data(fd, &reference_header, &pos); + read_uint32be_mp3data(fd, &reference_header); // lseek(fd, -info.frame_size, SEEK_CUR); |