notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
allow to disable SH2 dynarec on runtime
[picodrive.git]
/
platform
/
common
/
mp3.c
diff --git
a/platform/common/mp3.c
b/platform/common/mp3.c
index
9b347e8
..
ad3d70e
100644
(file)
--- a/
platform/common/mp3.c
+++ b/
platform/common/mp3.c
@@
-103,7
+103,7
@@
out:
return retval;
}
return retval;
}
-void mp3_start_play(void *f_, int pos)
+void mp3_start_play(void *f_, int pos
1024
)
{
unsigned char buf[2048];
FILE *f = f_;
{
unsigned char buf[2048];
FILE *f = f_;
@@
-117,13
+117,6
@@
void mp3_start_play(void *f_, int pos)
if (!(PicoOpt & POPT_EN_MCD_CDDA) || f == NULL) // cdda disabled or no file?
return;
if (!(PicoOpt & POPT_EN_MCD_CDDA) || f == NULL) // cdda disabled or no file?
return;
- ret = mp3dec_start();
- if (ret != 0)
- return;
-
- decoder_active = 1;
-
- mp3_current_file = f;
fseek(f, 0, SEEK_END);
mp3_file_len = ftell(f);
fseek(f, 0, SEEK_END);
mp3_file_len = ftell(f);
@@
-144,12
+137,20
@@
void mp3_start_play(void *f_, int pos)
}
// seek..
}
// seek..
- if (pos) {
+ if (pos
1024 != 0
) {
unsigned long long pos64 = mp3_file_len - mp3_file_pos;
unsigned long long pos64 = mp3_file_len - mp3_file_pos;
- pos64 *= pos;
+ pos64 *= pos
1024
;
mp3_file_pos += pos64 >> 10;
}
mp3_file_pos += pos64 >> 10;
}
+ ret = mp3dec_start(f, mp3_file_pos);
+ if (ret != 0) {
+ return;
+ }
+
+ mp3_current_file = f;
+ decoder_active = 1;
+
mp3dec_decode(mp3_current_file, &mp3_file_pos, mp3_file_len);
}
mp3dec_decode(mp3_current_file, &mp3_file_pos, mp3_file_len);
}
@@
-182,8
+183,9
@@
void mp3_update(int *buffer, int length, int stereo)
} else {
int ret, left = 1152 - cdda_out_pos;
} else {
int ret, left = 1152 - cdda_out_pos;
- mix_samples(buffer, cdda_out_buffer + cdda_out_pos * 2,
- (left >> shr) * 2);
+ if (left > 0)
+ mix_samples(buffer, cdda_out_buffer + cdda_out_pos * 2,
+ (left >> shr) * 2);
ret = mp3dec_decode(mp3_current_file, &mp3_file_pos,
mp3_file_len);
ret = mp3dec_decode(mp3_current_file, &mp3_file_pos,
mp3_file_len);