Index: squeezeplay/src/audio/decode/decode_flac.c =================================================================== --- squeezeplay/src/audio/decode/decode_flac.c (revision 8503) +++ squeezeplay/src/audio/decode/decode_flac.c (working copy) @@ -159,7 +159,7 @@ * FLAC frame is too large to use that, so we pick a value that will work most * of the time. */ - if (streambuf_would_wait_for(25000)) { + if (streambuf_would_wait_for(DECODE_MINIMUM_BYTES_FLAC)) { return FALSE; } Index: squeezeplay/src/audio/decode/decode.c =================================================================== --- squeezeplay/src/audio/decode/decode.c (revision 8503) +++ squeezeplay/src/audio/decode/decode.c (working copy) @@ -342,7 +342,8 @@ } /* Small delay if the stream empty but still streaming? */ - if (streambuf_would_wait_for(512)) { + /* special case for flac as it has a minimum number of bytes before the decoder processes anything */ + if (streambuf_would_wait_for(decoder == &decode_flac ? DECODE_MINIMUM_BYTES_FLAC : DECODE_MINIMUM_BYTES_OTHER)) { *delay = DECODE_WAIT_INTERVAL; return false; Index: squeezeplay/src/audio/decode/decode.h =================================================================== --- squeezeplay/src/audio/decode/decode.h (revision 8503) +++ squeezeplay/src/audio/decode/decode.h (working copy) @@ -35,4 +35,9 @@ #define TESTTONES_SINE40_192000 14 +/* Minimum bytes in streambuf before we start decoding */ +#define DECODE_MINIMUM_BYTES_FLAC 25000 +#define DECODE_MINIMUM_BYTES_OTHER 512 + + extern int luaopen_decode(lua_State *L);