summaryrefslogtreecommitdiff
path: root/apps/codecs
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs')
-rw-r--r--apps/codecs/libtta/ttadec.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/codecs/libtta/ttadec.c b/apps/codecs/libtta/ttadec.c
index 9d53a327f2..cdaffcd9d9 100644
--- a/apps/codecs/libtta/ttadec.c
+++ b/apps/codecs/libtta/ttadec.c
@@ -77,7 +77,7 @@ static unsigned char *bitpos IBSS_ATTR;
77/********************* rockbox helper functions *************************/ 77/********************* rockbox helper functions *************************/
78 78
79/* emulate stdio functions */ 79/* emulate stdio functions */
80static int fread(void *ptr, size_t size, size_t nobj) 80static size_t tta_fread(void *ptr, size_t size, size_t nobj)
81{ 81{
82 size_t read_size; 82 size_t read_size;
83 unsigned char *buffer = ci->request_buffer(&read_size, size * nobj); 83 unsigned char *buffer = ci->request_buffer(&read_size, size * nobj);
@@ -90,7 +90,7 @@ static int fread(void *ptr, size_t size, size_t nobj)
90 return read_size; 90 return read_size;
91} 91}
92 92
93static int fseek(long offset, int origin) 93static int tta_fseek(long offset, int origin)
94{ 94{
95 switch (origin) 95 switch (origin)
96 { 96 {
@@ -129,7 +129,7 @@ crc32 (unsigned char *buffer, unsigned int len) {
129#define GET_BINARY(value, bits) \ 129#define GET_BINARY(value, bits) \
130 while (bit_count < bits) { \ 130 while (bit_count < bits) { \
131 if (bitpos == iso_buffers_end) { \ 131 if (bitpos == iso_buffers_end) { \
132 if (!fread(isobuffers, 1, ISO_BUFFERS_SIZE)) { \ 132 if (!tta_fread(isobuffers, 1, ISO_BUFFERS_SIZE)) { \
133 ttainfo->STATE = READ_ERROR; \ 133 ttainfo->STATE = READ_ERROR; \
134 return -1; \ 134 return -1; \
135 } \ 135 } \
@@ -149,7 +149,7 @@ crc32 (unsigned char *buffer, unsigned int len) {
149 value = 0; \ 149 value = 0; \
150 while (!(bit_cache ^ bit_mask[bit_count])) { \ 150 while (!(bit_cache ^ bit_mask[bit_count])) { \
151 if (bitpos == iso_buffers_end) { \ 151 if (bitpos == iso_buffers_end) { \
152 if (!fread(isobuffers, 1, ISO_BUFFERS_SIZE)) { \ 152 if (!tta_fread(isobuffers, 1, ISO_BUFFERS_SIZE)) { \
153 ttainfo->STATE = READ_ERROR; \ 153 ttainfo->STATE = READ_ERROR; \
154 return -1; \ 154 return -1; \
155 } \ 155 } \
@@ -207,7 +207,7 @@ static int done_buffer_read(void) {
207 207
208 if (rbytes < sizeof(int)) { 208 if (rbytes < sizeof(int)) {
209 ci->memcpy(isobuffers, bitpos, 4); 209 ci->memcpy(isobuffers, bitpos, 4);
210 if (!fread(isobuffers + rbytes, 1, ISO_BUFFERS_SIZE - rbytes)) 210 if (!tta_fread(isobuffers + rbytes, 1, ISO_BUFFERS_SIZE - rbytes))
211 return -1; 211 return -1;
212 bitpos = isobuffers; 212 bitpos = isobuffers;
213 } 213 }
@@ -249,10 +249,10 @@ int set_tta_info (tta_info *info)
249 ci->memset (info, 0, sizeof(tta_info)); 249 ci->memset (info, 0, sizeof(tta_info));
250 250
251 /* skip id3v2 tags */ 251 /* skip id3v2 tags */
252 fseek(ci->id3->id3v2len, SEEK_SET); 252 tta_fseek(ci->id3->id3v2len, SEEK_SET);
253 253
254 /* read TTA header */ 254 /* read TTA header */
255 if (fread (&ttahdr, 1, sizeof (ttahdr)) == 0) { 255 if (tta_fread (&ttahdr, 1, sizeof (ttahdr)) == 0) {
256 info->STATE = READ_ERROR; 256 info->STATE = READ_ERROR;
257 return -1; 257 return -1;
258 } 258 }
@@ -374,7 +374,7 @@ int set_position (unsigned int pos, enum tta_seek_type type)
374 return -1; 374 return -1;
375 } 375 }
376 seek_pos = ttainfo->DATAPOS + seek_table[data_pos = pos]; 376 seek_pos = ttainfo->DATAPOS + seek_table[data_pos = pos];
377 if (fseek(seek_pos, SEEK_SET) < 0) { 377 if (tta_fseek(seek_pos, SEEK_SET) < 0) {
378 ttainfo->STATE = READ_ERROR; 378 ttainfo->STATE = READ_ERROR;
379 return -1; 379 return -1;
380 } 380 }
@@ -418,7 +418,7 @@ int player_init (tta_info *info) {
418 } 418 }
419 419
420 /* read seek table */ 420 /* read seek table */
421 if (!fread(seek_table, st_size, 1)) { 421 if (!tta_fread(seek_table, st_size, 1)) {
422 ttainfo->STATE = READ_ERROR; 422 ttainfo->STATE = READ_ERROR;
423 return -1; 423 return -1;
424 } 424 }