bluez5: handle no data written to sco socket

If socket write results to EAGAIN/EWOULDBLOCK or rx data starts late,
spa_bt_sco_io_write may return 0, and we should give up and skip ahead
(and not loop in RT thread with very small timeout).
This commit is contained in:
Pauli Virtanen 2021-07-22 22:22:40 +03:00 committed by Wim Taymans
parent 762e549027
commit cb10d87bb8

View file

@ -458,6 +458,9 @@ static void flush_data(struct impl *this)
if (written < 0) {
spa_log_warn(this->log, "sco-sink: write failure: %d", written);
goto stop;
} else if (written == 0) {
/* EAGAIN or similar, just skip ahead */
written = SPA_MIN(port->write_buffer_size, (uint32_t)48);
}
processed = written;