notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
move more globals to PicoInterface
[picodrive.git]
/
platform
/
common
/
mp3.c
diff --git
a/platform/common/mp3.c
b/platform/common/mp3.c
index
ad3d70e
..
c84962c
100644
(file)
--- a/
platform/common/mp3.c
+++ b/
platform/common/mp3.c
@@
-90,8
+90,9
@@
int mp3_get_bitrate(void *f_, int len)
if (ret <= 0) {
// try to read somewhere around the middle
fseek(f, len / 2, SEEK_SET);
if (ret <= 0) {
// try to read somewhere around the middle
fseek(f, len / 2, SEEK_SET);
- fread(buf, 1, sizeof(buf), f);
- ret = try_get_bitrate(buf, sizeof(buf));
+ ret = fread(buf, 1, sizeof(buf), f);
+ if (ret == sizeof(buf))
+ ret = try_get_bitrate(buf, sizeof(buf));
}
if (ret > 0)
retval = ret;
}
if (ret > 0)
retval = ret;
@@
-114,7
+115,7
@@
void mp3_start_play(void *f_, int pos1024)
cdda_out_pos = 0;
decoder_active = 0;
cdda_out_pos = 0;
decoder_active = 0;
- if (!(Pico
O
pt & POPT_EN_MCD_CDDA) || f == NULL) // cdda disabled or no file?
+ if (!(Pico
In.o
pt & POPT_EN_MCD_CDDA) || f == NULL) // cdda disabled or no file?
return;
fseek(f, 0, SEEK_END);
return;
fseek(f, 0, SEEK_END);
@@
-166,11
+167,11
@@
void mp3_update(int *buffer, int length, int stereo)
return;
length_mp3 = length;
return;
length_mp3 = length;
- if (PsndRate <= 11025 + 100) {
+ if (P
icoIn.
sndRate <= 11025 + 100) {
mix_samples = mix_16h_to_32_s2;
length_mp3 <<= 2; shr = 2;
}
mix_samples = mix_16h_to_32_s2;
length_mp3 <<= 2; shr = 2;
}
- else if (PsndRate <= 22050 + 100) {
+ else if (P
icoIn.
sndRate <= 22050 + 100) {
mix_samples = mix_16h_to_32_s1;
length_mp3 <<= 1; shr = 1;
}
mix_samples = mix_16h_to_32_s1;
length_mp3 <<= 1; shr = 1;
}