* [PATCH BlueZ 1/4] audio/player: Fix using invalid end index
@ 2014-01-30 23:03 Luiz Augusto von Dentz
2014-01-30 23:03 ` [PATCH BlueZ 2/4] audio/AVRCP: Fix using the wrong octet for folder type Luiz Augusto von Dentz
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2014-01-30 23:03 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
When the End index is not set in ListItems the code automatically pick
the number of items as end index but the start index start with 0 so
the correct is to use number of items - 1.
---
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 e6d24eb..2bd2d6e 100644
--- a/profiles/audio/player.c
+++ b/profiles/audio/player.c
@@ -808,7 +808,8 @@ static int parse_filters(struct media_player *player, DBusMessageIter *iter,
int ctype;
*start = 0;
- *end = folder->number_of_items ? folder->number_of_items : UINT32_MAX;
+ *end = folder->number_of_items ? folder->number_of_items - 1 :
+ UINT32_MAX;
ctype = dbus_message_iter_get_arg_type(iter);
if (ctype != DBUS_TYPE_ARRAY)
--
1.8.4.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH BlueZ 2/4] audio/AVRCP: Fix using the wrong octet for folder type
2014-01-30 23:03 [PATCH BlueZ 1/4] audio/player: Fix using invalid end index Luiz Augusto von Dentz
@ 2014-01-30 23:03 ` Luiz Augusto von Dentz
2014-01-30 23:03 ` [PATCH BlueZ 3/4] audio/AVRCP: Fix not setting playable flag for folder Luiz Augusto von Dentz
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2014-01-30 23:03 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Folder type is the 9 octet not the 10.
---
profiles/audio/avrcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 63a6f7e..2cf6b41 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -2150,7 +2150,7 @@ static struct media_item *parse_media_folder(struct avrcp *session,
return NULL;
uid = bt_get_be64(&operands[0]);
- type = operands[9];
+ type = operands[8];
namelen = MIN(bt_get_be16(&operands[12]), sizeof(name) - 1);
if (namelen > 0) {
--
1.8.4.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH BlueZ 3/4] audio/AVRCP: Fix not setting playable flag for folder
2014-01-30 23:03 [PATCH BlueZ 1/4] audio/player: Fix using invalid end index Luiz Augusto von Dentz
2014-01-30 23:03 ` [PATCH BlueZ 2/4] audio/AVRCP: Fix using the wrong octet for folder type Luiz Augusto von Dentz
@ 2014-01-30 23:03 ` Luiz Augusto von Dentz
2014-01-30 23:03 ` [PATCH BlueZ 4/4] audio/AVRCP: Fix coding style Luiz Augusto von Dentz
2014-02-02 15:40 ` [PATCH BlueZ 1/4] audio/player: Fix using invalid end index Luiz Augusto von Dentz
3 siblings, 0 replies; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2014-01-30 23:03 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
When listing items some folders may be set as playable but the code was
ignoring it making it impossible to play any folder.
---
profiles/audio/avrcp.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 2cf6b41..ac861d2 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -2141,16 +2141,19 @@ static struct media_item *parse_media_folder(struct avrcp *session,
{
struct avrcp_player *player = session->controller->player;
struct media_player *mp = player->user_data;
+ struct media_item *item;
uint16_t namelen;
char name[255];
uint64_t uid;
uint8_t type;
+ uint8_t playable;
if (len < 12)
return NULL;
uid = bt_get_be64(&operands[0]);
type = operands[8];
+ playable = operands[9];
namelen = MIN(bt_get_be16(&operands[12]), sizeof(name) - 1);
if (namelen > 0) {
@@ -2158,7 +2161,13 @@ static struct media_item *parse_media_folder(struct avrcp *session,
name[namelen] = '\0';
}
- return media_player_create_folder(mp, name, type, uid);
+ item = media_player_create_folder(mp, name, type, uid);
+ if (!item)
+ return NULL;
+
+ media_item_set_playable(item, playable & 0x01);
+
+ return item;
}
static void avrcp_list_items(struct avrcp *session, uint32_t start,
--
1.8.4.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH BlueZ 4/4] audio/AVRCP: Fix coding style
2014-01-30 23:03 [PATCH BlueZ 1/4] audio/player: Fix using invalid end index Luiz Augusto von Dentz
2014-01-30 23:03 ` [PATCH BlueZ 2/4] audio/AVRCP: Fix using the wrong octet for folder type Luiz Augusto von Dentz
2014-01-30 23:03 ` [PATCH BlueZ 3/4] audio/AVRCP: Fix not setting playable flag for folder Luiz Augusto von Dentz
@ 2014-01-30 23:03 ` Luiz Augusto von Dentz
2014-01-31 7:55 ` Andrei Emeltchenko
2014-02-02 15:40 ` [PATCH BlueZ 1/4] audio/player: Fix using invalid end index Luiz Augusto von Dentz
3 siblings, 1 reply; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2014-01-30 23:03 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
profiles/audio/avrcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index ac861d2..4521bc4 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -2161,7 +2161,7 @@ static struct media_item *parse_media_folder(struct avrcp *session,
name[namelen] = '\0';
}
- item = media_player_create_folder(mp, name, type, uid);
+ item = media_player_create_folder(mp, name, type, uid);
if (!item)
return NULL;
--
1.8.4.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH BlueZ 4/4] audio/AVRCP: Fix coding style
2014-01-30 23:03 ` [PATCH BlueZ 4/4] audio/AVRCP: Fix coding style Luiz Augusto von Dentz
@ 2014-01-31 7:55 ` Andrei Emeltchenko
2014-01-31 17:14 ` Luiz Augusto von Dentz
0 siblings, 1 reply; 7+ messages in thread
From: Andrei Emeltchenko @ 2014-01-31 7:55 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hi Luiz,
On Thu, Jan 30, 2014 at 03:03:28PM -0800, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> ---
> profiles/audio/avrcp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
> index ac861d2..4521bc4 100644
> --- a/profiles/audio/avrcp.c
> +++ b/profiles/audio/avrcp.c
> @@ -2161,7 +2161,7 @@ static struct media_item *parse_media_folder(struct avrcp *session,
> name[namelen] = '\0';
> }
>
> - item = media_player_create_folder(mp, name, type, uid);
> + item = media_player_create_folder(mp, name, type, uid);
what is the point creating this patch instead of merging with previous one
which introduced this style issue?
Best regards
Andrei Emeltchenko
> if (!item)
> return NULL;
>
> --
> 1.8.4.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH BlueZ 4/4] audio/AVRCP: Fix coding style
2014-01-31 7:55 ` Andrei Emeltchenko
@ 2014-01-31 17:14 ` Luiz Augusto von Dentz
0 siblings, 0 replies; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2014-01-31 17:14 UTC (permalink / raw)
To: Andrei Emeltchenko, Luiz Augusto von Dentz, linux-bluetooth
Hi Andrei,
On Thu, Jan 30, 2014 at 11:55 PM, Andrei Emeltchenko
<andrei.emeltchenko.news@gmail.com> wrote:
> Hi Luiz,
>
> On Thu, Jan 30, 2014 at 03:03:28PM -0800, Luiz Augusto von Dentz wrote:
>> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>>
>> ---
>> profiles/audio/avrcp.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
>> index ac861d2..4521bc4 100644
>> --- a/profiles/audio/avrcp.c
>> +++ b/profiles/audio/avrcp.c
>> @@ -2161,7 +2161,7 @@ static struct media_item *parse_media_folder(struct avrcp *session,
>> name[namelen] = '\0';
>> }
>>
>> - item = media_player_create_folder(mp, name, type, uid);
>> + item = media_player_create_folder(mp, name, type, uid);
>
> what is the point creating this patch instead of merging with previous one
> which introduced this style issue?
Just a honest mistake, will fix it.
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH BlueZ 1/4] audio/player: Fix using invalid end index
2014-01-30 23:03 [PATCH BlueZ 1/4] audio/player: Fix using invalid end index Luiz Augusto von Dentz
` (2 preceding siblings ...)
2014-01-30 23:03 ` [PATCH BlueZ 4/4] audio/AVRCP: Fix coding style Luiz Augusto von Dentz
@ 2014-02-02 15:40 ` Luiz Augusto von Dentz
3 siblings, 0 replies; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2014-02-02 15:40 UTC (permalink / raw)
To: linux-bluetooth
Hi,
On Thu, Jan 30, 2014 at 3:03 PM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> When the End index is not set in ListItems the code automatically pick
> the number of items as end index but the start index start with 0 so
> the correct is to use number of items - 1.
> ---
> 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 e6d24eb..2bd2d6e 100644
> --- a/profiles/audio/player.c
> +++ b/profiles/audio/player.c
> @@ -808,7 +808,8 @@ static int parse_filters(struct media_player *player, DBusMessageIter *iter,
> int ctype;
>
> *start = 0;
> - *end = folder->number_of_items ? folder->number_of_items : UINT32_MAX;
> + *end = folder->number_of_items ? folder->number_of_items - 1 :
> + UINT32_MAX;
>
> ctype = dbus_message_iter_get_arg_type(iter);
> if (ctype != DBUS_TYPE_ARRAY)
> --
> 1.8.4.2
Pushed after fixing patch 4/4.
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-02-02 15:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-30 23:03 [PATCH BlueZ 1/4] audio/player: Fix using invalid end index Luiz Augusto von Dentz
2014-01-30 23:03 ` [PATCH BlueZ 2/4] audio/AVRCP: Fix using the wrong octet for folder type Luiz Augusto von Dentz
2014-01-30 23:03 ` [PATCH BlueZ 3/4] audio/AVRCP: Fix not setting playable flag for folder Luiz Augusto von Dentz
2014-01-30 23:03 ` [PATCH BlueZ 4/4] audio/AVRCP: Fix coding style Luiz Augusto von Dentz
2014-01-31 7:55 ` Andrei Emeltchenko
2014-01-31 17:14 ` Luiz Augusto von Dentz
2014-02-02 15:40 ` [PATCH BlueZ 1/4] audio/player: Fix using invalid end index Luiz Augusto von Dentz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.