Re: [PATCH 4/5] avrcp: fix handling of metadata item 0x7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Lucas and David,

On Thu, Sep 15, 2011 at 7:21 AM, Lucas De Marchi
<lucas.demarchi@xxxxxxxxxxxxxx> wrote:
> From: David Stockwell <dstockwell@xxxxxxxxxxxxxxxxx>
>
> Metadata field number 0x7 should be the total playing time of the track
> (TrackDuration) in msec, not current position within track.
> ---
>  audio/avrcp.c |   18 ++++++------------
>  1 files changed, 6 insertions(+), 12 deletions(-)
>
> diff --git a/audio/avrcp.c b/audio/avrcp.c
> index f7f3924..835249b 100644
> --- a/audio/avrcp.c
> +++ b/audio/avrcp.c
> @@ -141,7 +141,7 @@ enum media_info_id {
>        MEDIA_INFO_TRACK =              4,
>        MEDIA_INFO_N_TRACKS =           5,
>        MEDIA_INFO_GENRE =              6,
> -       MEDIA_INFO_CURRENT_POSITION =   7,
> +       MEDIA_INFO_PLAYING_TIME =       7,
>        MEDIA_INFO_LAST
>  };
>
> @@ -690,19 +690,13 @@ static int mp_get_media_attribute(struct media_player *mp,
>                len = strlen(valstr);
>                memcpy(elem->val, valstr, len);
>                break;
> -       case MEDIA_INFO_CURRENT_POSITION:
> -               if (mi->elapsed != 0xFFFFFFFF) {
> -                       uint32_t elapsed;
> -
> -                       mp_get_playback_status(mp, NULL, &elapsed, NULL);
> -
> -                       snprintf(valstr, 20, "%u", elapsed);
> -                       len = strlen(valstr);
> -                       memcpy(elem->val, valstr, len);
> -               } else {
> +       case MEDIA_INFO_PLAYING_TIME:
> +               if (mi->track_len == 0xFFFFFFFF)
>                        return -ENOENT;
> -               }
>
> +               snprintf(valstr, 20, "%u", mi->track_len);
> +               len = strlen(valstr);
> +               memcpy(elem->val, valstr, len);
>                break;
>        default:
>                return -EINVAL;
> --
> 1.7.6.1

Ack.

-- 
Luiz Augusto von Dentz
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux