Change includes so that things build without include dir shenanigans
[picodrive.git] / platform / common / mp3.c
index ad3d70e..01ac782 100644 (file)
@@ -8,8 +8,8 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <pico/pico_int.h>
-#include <pico/sound/mix.h>
+#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;