bluetooth: Only perform write-related calculations when we have a sink
authorPali Rohár <pali.rohar@gmail.com>
Tue, 27 Aug 2019 03:11:27 +0000 (08:41 +0530)
committerArun Raghavan <arun@arunraghavan.net>
Tue, 27 Aug 2019 03:14:27 +0000 (08:44 +0530)
commitbdf66c4693c8775dc3c4a403cbae77a56d4b1e29
tree9e226d6e7b1ea5bc12849be248494abb14328c4c
parent1172daf19b06a4169ba26cde570566f14a3ebdf2
bluetooth: Only perform write-related calculations when we have a sink

This avoids a potential divide-by-zero when we try to decide how much to
write to the sink in the source thread when there is no sink.

Fixes https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/717
src/modules/bluetooth/module-bluez5-device.c