solved most of click issues

This commit is contained in:
philippe44
2019-08-24 00:55:38 -07:00
parent 655af81a97
commit 35ccb92a60
3 changed files with 18 additions and 12 deletions

View File

@@ -50,7 +50,7 @@ static struct {
*/
static void sink_data_handler(const uint8_t *data, uint32_t len)
{
size_t bytes, space;
size_t bytes;
// would be better to lock decoder, but really, it does not matter
if (decode.state != DECODE_STOPPED) {
@@ -75,7 +75,6 @@ static void sink_data_handler(const uint8_t *data, uint32_t len)
}
#endif
_buf_inc_writep(outputbuf, bytes);
space = _buf_space(outputbuf);
len -= bytes;
data += bytes;
@@ -83,7 +82,7 @@ static void sink_data_handler(const uint8_t *data, uint32_t len)
UNLOCK_O;
// allow i2s to empty the buffer if needed
if (len && !space) usleep(50000);
if (len) usleep(50000);
}
}
@@ -190,7 +189,7 @@ void raop_sink_cmd_handler(raop_event_t event, void *param)
// in how many ms will the most recent block play
ms = ((u64_t) ((_buf_used(outputbuf) - raop_sync.len) / BYTES_PER_FRAME + output.device_frames + output.frames_in_process) * 1000) / RAOP_SAMPLE_RATE - (now - output.updated);
error = (raop_sync.playtime - now) - ms;
LOG_DEBUG("head local:%u, remote:%u (delta:%d)", ms, raop_sync.playtime - now, error);
LOG_INFO("head local:%u, remote:%u (delta:%d)", ms, raop_sync.playtime - now, error);
LOG_DEBUG("obuf:%u, sync_len:%u, devframes:%u, inproc:%u", _buf_used(outputbuf), raop_sync.len, output.device_frames, output.frames_in_process);
}