From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ] audio/player: Fix overflowing position
Date: Wed, 31 Jul 2013 14:27:52 +0300 [thread overview]
Message-ID: <1375270072-13140-1-git-send-email-luiz.dentz@gmail.com> (raw)
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The position should stop at UINT32_MAX after that the progress can no
longer be calculated, this should also prevent the position to change
when the remote stack doesn't support it which is also indicated with
UINT32_MAX which apparently is the case of Spotify on Android 4.3:
[CHG] Player /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/player0 Position: 0xffffffff
[CHG] Player /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/player0 Status: playing
[CHG] Player /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/player0 Position: 0x000000
---
profiles/audio/player.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/profiles/audio/player.c b/profiles/audio/player.c
index ce5e75b..6150c8a 100644
--- a/profiles/audio/player.c
+++ b/profiles/audio/player.c
@@ -151,7 +151,8 @@ static uint32_t media_player_get_position(struct media_player *mp)
double timedelta;
uint32_t sec, msec;
- if (g_strcmp0(mp->status, "playing") != 0)
+ if (g_strcmp0(mp->status, "playing") != 0 ||
+ mp->position == UINT32_MAX)
return mp->position;
timedelta = g_timer_elapsed(mp->progress, NULL);
--
1.8.3.1
next reply other threads:[~2013-07-31 11:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-31 11:27 Luiz Augusto von Dentz [this message]
2013-07-31 11:37 ` [PATCH BlueZ] audio/player: Fix overflowing position Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1375270072-13140-1-git-send-email-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox