OSDN Git Service

AVRCP: Fix changing track metadata too many times
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 25 Feb 2013 13:31:08 +0000 (15:31 +0200)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 5 Mar 2013 09:23:42 +0000 (11:23 +0200)
commit283dc309af89c26f1b1c20780cde7ffd6e2f8f7e
treeff4ab414e391191e44b54c727554e619eb2cc25a
parent1439c6546d0889fbfba5ed184cf34fc4e9f5126c
AVRCP: Fix changing track metadata too many times

Certain stacks may respond to GetPlayStatus before GetItemAttributes
(e.g iOS 6), which may cause Track to be changed due to duration being
different.

To fix this the code now only attempt to do GetPlayStatus once
GetItemAttributes completes, in addition to this do not require a exact
match of the duration because they can be different as can be observed
bellow:

> L2CAP(d): cid 0x0044 len 141 ctrl 0x0c16 fcs 0xa5ad [psm 27]
    I-frame: Unsegmented TxSeq 11 ReqSeq 12
    AVCTP Browsing: Response : pt 0x00 transaction 11 pid 0x110e
      AVRCP: GetItemAttributes: len 0x0083
...
        AttributeID: 0x00000007 (Track duration)
        CharsetID: 0x006a (UTF-8)
        AttributeLength: 0x0006 (6)
        AttributeValue: 222641
...
> L2CAP(d): cid 0x0043 len 22 [psm 23]
    AVCTP Control: Response : pt 0x00 transaction 2 pid 0x110e
      AV/C: Stable: address 0x48 opcode 0x00
        Subunit: Panel
        Opcode: Vendor Dependent
        Company ID: 0x001958
        AVRCP: GetPlayStatus: pt Single len 0x0009
          SongLength: 0x00036597 (222615 miliseconds)
          SongPosition: 0x00000000 (0 miliconds)
          PlayStatus: 0x02 (PAUSED)
profiles/audio/avrcp.c
profiles/audio/player.c