X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fcommon%2Fmp3.c;h=01ac7823d42cbb0304935cdc899655ad168926a8;hb=5c4adfbaec6c6950797479d5e5a8c4736179e2d5;hp=ad3d70e53a4aa265f83d2d82ff330950ecd47a41;hpb=75a30842c4f9e7e95a199361b9348c9f9dede0e6;p=picodrive.git diff --git a/platform/common/mp3.c b/platform/common/mp3.c index ad3d70e..01ac782 100644 --- a/platform/common/mp3.c +++ b/platform/common/mp3.c @@ -8,8 +8,8 @@ #include #include -#include -#include +#include "../../pico/pico_int.h" +#include "../../pico/sound/mix.h" #include "mp3.h" static FILE *mp3_current_file; @@ -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); - 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;