transport: Fix not being able to initialize volume properly
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 27 Apr 2022 20:14:19 +0000 (13:14 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:54 +0000 (14:55 +0530)
commit17f9c8d18d9c685417386545d225df8f019a09db
tree10b8b0849a1c3a8591f548a9ee211b1278db82b4
parent4d6e478ecf46037352b61b629e8a1cb3ac9bb26f
transport: Fix not being able to initialize volume properly

In case AVRCP is connected first and
media_transport_update_device_volume is called without any media_player
being available the volume setting would be lost and Transport.Volume
won't be available, so this introduces btd_device_{set,get}_volume
helpers which is used to store the volume temporarely so
media_player_get_device_volume is able to restore it when the transport
is created.

Fixes: https://github.com/bluez/bluez/issues/335
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
profiles/audio/media.c
profiles/audio/transport.c
src/device.c
src/device.h