Index: apps/playback.c =================================================================== --- apps/playback.c (revision 22682) +++ apps/playback.c (working copy) @@ -29,6 +29,7 @@ #include #include "system.h" +#include "config.h" #include "thread.h" #include "file.h" #include "panic.h" @@ -1669,13 +1670,18 @@ } } +/* disable buffering of codec file in ringbuffer for low memory targets*/ +/* stable MP3 playing to be tested, issue is automatic skip with new */ +/* codec, cuesheets may also be an issue */ + +#if MEMORYSIZE > 2 codec_get_full_path(codec_path, codec_fn); - tracks[track_widx].codec_hid = bufopen(codec_path, 0, TYPE_CODEC); if (tracks[track_widx].codec_hid < 0) return false; logf("Loaded codec"); +#endif return true; } Index: apps/buffering.c =================================================================== --- apps/buffering.c (revision 22682) +++ apps/buffering.c (working copy) @@ -426,7 +426,7 @@ newpos = RINGBUF_ADD((void *)src - (void *)buffer, final_delta); overlap = RINGBUF_ADD_CROSS(newpos, size_to_move, buffer_len - 1); - if (overlap > 0) { + if (overlap > 0 && (unsigned)overlap < size_to_move ) { /* Some part of the struct + data would wrap, maybe ok */ size_t correction = 0; /* If the overlap lands inside the memory_handle */