diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2015-05-07 16:55:19 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2016-03-11 11:38:53 +0200 |
commit | 1a3d320f122b696792dcda0389031ace1dd55b28 (patch) | |
tree | 9944cc7f8bcdf4573207011eab28dbeffc78d847 /profiles/audio/avrcp.c | |
parent | 24548faf1810491d9cd3b9fbd97c002d68bbfed6 (diff) | |
download | bluez-1a3d320f122b696792dcda0389031ace1dd55b28.tar.gz |
audio/player: Resync if Position property is read
Request position to be resync if status is playing and position is
supported.
Diffstat (limited to 'profiles/audio/avrcp.c')
-rw-r--r-- | profiles/audio/avrcp.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c index f9980b37e..136f4a463 100644 --- a/profiles/audio/avrcp.c +++ b/profiles/audio/avrcp.c @@ -2790,6 +2790,23 @@ static void avrcp_set_player_value(struct avrcp *session, uint8_t attr, avrcp_player_value_rsp, session); } +static bool ct_get_position(struct media_player *mp, void *user_data) +{ + struct avrcp_player *player = user_data; + struct avrcp *session; + + session = player->sessions->data; + if (session == NULL) + return false; + + if (session->controller->version < 0x0103) + return false; + + avrcp_get_play_status(session); + + return true; +} + static bool ct_set_setting(struct media_player *mp, const char *key, const char *value, void *user_data) { @@ -3175,6 +3192,7 @@ static int ct_get_total_numberofitems(struct media_player *mp, const char *name, } static const struct media_player_callback ct_cbs = { + .get_position = ct_get_position, .set_setting = ct_set_setting, .play = ct_play, .pause = ct_pause, |