Commit Graph

13 Commits

Author SHA1 Message Date
Lucas De Marchi
b6379821a6 AVRCP: fix loop over number of application settings 2011-10-06 15:35:35 +03:00
Luiz Augusto von Dentz
14ae307458 AVRCP: move MediaPlayer to adapter object
This move the MediaPlayer registration to adapter object on Media
interface so we can track players properly.
2011-10-06 11:13:28 +03:00
Lucas De Marchi
4d3bb39485 AVRCP: fix missing bytes on notification 2011-10-03 16:14:12 +03:00
Lucas De Marchi
4364aa411d AVRCP: fix changed notification
We sure want to send notifications only when section is not NULL.
Otherwise we either crash or do not send the expected notification.
2011-10-02 18:52:05 +03:00
Lucas De Marchi
8ebb3c79e1 AVRCP: fix case when only one setting is provided
If CT tries to change an Application Setting providing only one
setting, the size of the PDU will be 3 bytes. Therefore we should check
if the PDU is shorter than or equal 3, not only shorter.
2011-10-02 18:48:06 +03:00
Lucas De Marchi
138f831787 AVRCP: return empty string instead of rejecting
If media attribute is not available for a certain media file, return an
empty string instead of rejecting the request. The spec is not so clear
if only the title should be handled as an empty string when not present,
but this is the only alternative to rejecting the request.

IOP tests showed that some CT devices don't like reject messages: they
never ask for an attribute again if they previously received a REJECTED
message for that attribute. They consider REJECTED as "TG doesn't
implement it these optional attributes" as opposed to what we had
before, "this attribute is currently not available".
2011-10-02 18:47:58 +03:00
Lucas De Marchi
6d0ec74904 AVRCP: limit AVRCP packet size to the MTU of AV/C
AVRCP is an extension of AV/C spec which has a limit of 512 bytes. The
only place where it can exceed this value is in the response to
GetElementAttributes command.

Now we simply don't add the attributes that would overflow the available
buffer space.
2011-09-27 13:11:35 +03:00
David Stockwell
4dc449c1e3 avrcp: get/set three-byte company-id 2011-09-16 11:32:12 +03:00
David Stockwell
232ba15531 avrcp: fix handling of metadata item 0x7
Metadata field number 0x7 should be the total playing time of the track
(TrackDuration) in msec, not current position within track.
2011-09-16 11:32:10 +03:00
David Stockwell
b0de2a7bc2 avrcp: use LAST element on media_info_id enum 2011-09-16 11:32:08 +03:00
Lucas De Marchi
f2ac0034a0 avrcp: fix overwrite of number of attributes
The response of GetCurrentPlayerApplicationSettingValue expects the
first operand to be the number of attributes in response. Since we start
with len=0, we were overwriting this number with the value of the first
attribute.

Also use g_memdup instead of g_malloc + memcpy.
2011-09-16 11:32:06 +03:00
Lucas De Marchi
66b9d4c7a0 avrcp: fix missing error code 2011-09-16 11:32:04 +03:00
Luiz Augusto von Dentz
99f32ae9ac AVRCP: move handling of vendor dependent PDU from control.c to avrcp.c
This helps to isolate AVRCP PDU handling and MediaPlayer interface.
2011-09-13 10:44:56 +03:00