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;
#include "common/version.h"
#include "libretro.h"
-#ifndef MAP_ANONYMOUS
-#define MAP_ANONYMOUS MAP_ANON
-#endif
-
static retro_video_refresh_t video_cb;
static retro_input_poll_t input_poll_cb;
static retro_input_state_t input_state_cb;
/* ruh-ro, we leaked handle from CreateFileMapping() ... */
}
#endif
+
+#ifndef MAP_ANONYMOUS
+#define MAP_ANONYMOUS MAP_ANON
+#endif
+
void *plat_mmap(unsigned long addr, size_t size, int need_exec, int is_fixed)
{
int flags = MAP_PRIVATE | MAP_ANONYMOUS;