X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=common%2Fmp3_helix.c;h=4a4931ffc46c6eade4cc0b3dfc18847b40a95f97;hb=3d792006acf30d67362146f9f448f753064a6fcf;hp=5f58aa5704ad853d924707a3291fcdab5fafbc23;hpb=9615b3dfdededf2b7d74963137b6ff9495e4d21e;p=libpicofe.git diff --git a/common/mp3_helix.c b/common/mp3_helix.c index 5f58aa5..4a4931f 100644 --- a/common/mp3_helix.c +++ b/common/mp3_helix.c @@ -196,8 +196,14 @@ void mp3_update(int *buffer, int length, int stereo) return; /* no file / EOF */ length_mp3 = length; - if (PsndRate == 22050) { mix_samples = mix_16h_to_32_s1; length_mp3 <<= 1; shr = 1; } - else if (PsndRate == 11025) { mix_samples = mix_16h_to_32_s2; length_mp3 <<= 2; shr = 2; } + if (PsndRate <= 11025 + 100) { + mix_samples = mix_16h_to_32_s2; + length_mp3 <<= 2; shr = 2; + } + else if (PsndRate <= 22050 + 100) { + mix_samples = mix_16h_to_32_s1; + length_mp3 <<= 1; shr = 1; + } if (1152 - mp3_buffer_offs >= length_mp3) { mix_samples(buffer, cdda_out_buffer + mp3_buffer_offs*2, length<<1);