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;
cdda_out_pos = 0;
decoder_active = 0;
- if (!(PicoOpt & POPT_EN_MCD_CDDA) || f == NULL) // cdda disabled or no file?
+ if (!(PicoIn.opt & POPT_EN_MCD_CDDA) || f == NULL) // cdda disabled or no file?
return;
fseek(f, 0, SEEK_END);
return;
length_mp3 = length;
- if (PsndRate <= 11025 + 100) {
+ if (PicoIn.sndRate <= 11025 + 100) {
mix_samples = mix_16h_to_32_s2;
length_mp3 <<= 2; shr = 2;
}
- else if (PsndRate <= 22050 + 100) {
+ else if (PicoIn.sndRate <= 22050 + 100) {
mix_samples = mix_16h_to_32_s1;
length_mp3 <<= 1; shr = 1;
}