bluetooth: don't call pa_sink_render with 0 bytes request

This commit is contained in:
Marc-André Lureau 2009-07-06 17:50:51 +03:00 committed by Lennart Poettering
parent ea5cdcbe52
commit fd32fee448

View file

@ -1319,11 +1319,13 @@ static void thread_func(void *userdata) {
if (u->write_index > 0 && audio_to_send > MAX_PLAYBACK_CATCH_UP_USEC) {
pa_usec_t skip_usec;
uint64_t skip_bytes;
pa_memchunk tmp;
skip_usec = audio_to_send - MAX_PLAYBACK_CATCH_UP_USEC;
skip_bytes = pa_usec_to_bytes(skip_usec, &u->sample_spec);
if (skip_bytes > 0) {
pa_memchunk tmp;
pa_log_warn("Skipping %llu us (= %llu bytes) in audio stream",
(unsigned long long) skip_usec,
(unsigned long long) skip_bytes);
@ -1332,6 +1334,7 @@ static void thread_func(void *userdata) {
pa_memblock_unref(tmp.memblock);
u->write_index += skip_bytes;
}
}
do_write = 1;
}