From: Lucas De Marchi <lucas.demarchi@profusion.mobi>
To: Michal Labedzki <michal.labedzki@tieto.com>
Cc: linux-bluetooth@vger.kernel.org, kanak.gupta@stericsson.com,
vani.patel@stericsson.com, joohi.rastogi@stericsson.com
Subject: Re: [PATCH 3/3] avrcp: Treat position as unknown when duration is unavailable
Date: Fri, 2 Mar 2012 18:31:23 -0300 [thread overview]
Message-ID: <CAMOw1v4A7rm_QaeLSVHxtTeWen7J_zT2WcQa9dD0zpZOh3ot5A@mail.gmail.com> (raw)
In-Reply-To: <1330613135-16552-3-git-send-email-michal.labedzki@tieto.com>
Hi Michal
On Thu, Mar 1, 2012 at 11:45 AM, Michal Labedzki
<michal.labedzki@tieto.com> wrote:
> According to the specification when duration and position are not
> supported then 0xFFFFFFFF should be returned. This patch avoid random
> position on stream where duration is not available.
> ---
> audio/avrcp.c | 10 ++++++----
> audio/media.c | 3 ++-
> 2 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/audio/avrcp.c b/audio/avrcp.c
> index 2d29d56..e141030 100644
> --- a/audio/avrcp.c
> +++ b/audio/avrcp.c
> @@ -859,16 +859,18 @@ static uint8_t avrcp_handle_get_play_status(struct avrcp_player *player,
> return AVC_CTYPE_REJECTED;
> }
>
> - position = player->cb->get_position(player->user_data);
> pduration = player->cb->get_metadata(AVRCP_MEDIA_ATTRIBUTE_DURATION,
> player->user_data);
>
> - if (pduration != NULL)
> + if (pduration != NULL) {
> duration = htonl(GPOINTER_TO_UINT(pduration));
> - else
> + position = htonl(player->cb->get_position(player->user_data));
Duration and position are independent. Only duration accepts
UINT32_MAX when it's not available. Position is always available
because we handle it inside bluetoothd.
Regards,
Lucas De Marchi
next prev parent reply other threads:[~2012-03-02 21:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-01 14:45 [PATCH 1/3] avrcp: Fix response ctype of AbortContinuingResponse Michal Labedzki
2012-03-01 14:45 ` [PATCH 2/3] avrcp: Add error code for rejected vendor command Michal Labedzki
2012-03-01 15:34 ` Luiz Augusto von Dentz
2012-03-02 9:39 ` Michal Labedzki
2012-03-02 16:59 ` Lucas De Marchi
2012-03-07 16:23 ` [PATCH v3] " Michal Labedzki
2012-03-13 11:51 ` Johan Hedberg
2012-03-01 14:45 ` [PATCH 3/3] avrcp: Treat position as unknown when duration is unavailable Michal Labedzki
2012-03-01 15:43 ` Luiz Augusto von Dentz
2012-03-02 21:31 ` Lucas De Marchi [this message]
2012-03-07 16:35 ` Michal Labedzki
2012-03-01 15:50 ` [PATCH 1/3] avrcp: Fix response ctype of AbortContinuingResponse Luiz Augusto von Dentz
2012-03-02 17:16 ` Lucas De Marchi
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=CAMOw1v4A7rm_QaeLSVHxtTeWen7J_zT2WcQa9dD0zpZOh3ot5A@mail.gmail.com \
--to=lucas.demarchi@profusion.mobi \
--cc=joohi.rastogi@stericsson.com \
--cc=kanak.gupta@stericsson.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=michal.labedzki@tieto.com \
--cc=vani.patel@stericsson.com \
/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;
as well as URLs for NNTP newsgroup(s).