]> code.delx.au - pulseaudio/commit
bluetooth: Fix bluetooth.nrec property not updated
authorFrédéric Danis <frederic.danis@linux.intel.com>
Tue, 12 Jun 2012 13:49:50 +0000 (15:49 +0200)
committerTanu Kaskinen <tanuk@iki.fi>
Fri, 15 Jun 2012 18:06:01 +0000 (21:06 +0300)
commit017e1c4dda581dccf12aa32099d771b977bb33e7
tree779e22df11588e4bfa26c6027bd1953f51056ab7
parenta91359956f166005749247eaa5f4001a4555689d
bluetooth: Fix bluetooth.nrec property not updated

PropertyChanged signal of org.BlueZ.MediaTransport is processed in
pa_bluetooth_transport_parse_property() which updates t->nrec.
This is called by :
- First by filter_cb() of bluetooth-util.c
- Then by filter_cb() of module-bluetooth-device.c which retrieve value
  of t->nrec before calling parse function, then it checks if t->nrec
  has changed before updating bluetooth.nrec property.
  As t->nrec has alreday been changed during first process, property
  update is never performed.

This patch creates a new hook in pa_bluetooth_transport called
PA_BLUETOOTH_TRANSPORT_HOOK_NREC_CHANGED.
The hook is fired by bluetooth-util.c when the transport's NREC
property changes.
module-bluetooth-device.c won't listen the PropertyChanged signal of
MediaTransport anymore. Instead, it will use the hook in
pa_bluetooth_transport to get a notification when the NREC property
changes, and update the sink or source proplist accordingly.

const qualifier for returned pointer of
pa_bluetooth_discovery_get_transport() is removed.
src/modules/bluetooth/bluetooth-util.c
src/modules/bluetooth/bluetooth-util.h
src/modules/bluetooth/module-bluetooth-device.c