From 579481ab70695fce50b4a5d189648a7722c133e2 Mon Sep 17 00:00:00 2001 From: lsde Date: Wed, 7 Jul 2021 23:03:39 +0000 Subject: [PATCH] Use correct RTP payload type for aptX, LDAC,SBC According to the A2DP spec, the payload type should be set to a number between 96 and 127. This is fixed for AAC codec, but not the rest. Original PulseAudio issue: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/591 --- spa/plugins/bluez5/a2dp-codec-aptx.c | 2 +- spa/plugins/bluez5/a2dp-codec-ldac.c | 2 +- spa/plugins/bluez5/a2dp-codec-sbc.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spa/plugins/bluez5/a2dp-codec-aptx.c b/spa/plugins/bluez5/a2dp-codec-aptx.c index 240da71dd..db3a43a9d 100644 --- a/spa/plugins/bluez5/a2dp-codec-aptx.c +++ b/spa/plugins/bluez5/a2dp-codec-aptx.c @@ -287,7 +287,7 @@ static int codec_start_encode (void *data, memset(this->header, 0, sizeof(struct rtp_header)); this->header->v = 2; - this->header->pt = 1; + this->header->pt = 96; this->header->sequence_number = htons(seqnum); this->header->timestamp = htonl(timestamp); return sizeof(struct rtp_header); diff --git a/spa/plugins/bluez5/a2dp-codec-ldac.c b/spa/plugins/bluez5/a2dp-codec-ldac.c index 5494cc50f..6407151fb 100644 --- a/spa/plugins/bluez5/a2dp-codec-ldac.c +++ b/spa/plugins/bluez5/a2dp-codec-ldac.c @@ -541,7 +541,7 @@ static int codec_start_encode (void *data, this->payload->frame_count = 0; this->header->v = 2; - this->header->pt = 1; + this->header->pt = 96; this->header->sequence_number = htons(seqnum); this->header->timestamp = htonl(timestamp); this->header->ssrc = htonl(1); diff --git a/spa/plugins/bluez5/a2dp-codec-sbc.c b/spa/plugins/bluez5/a2dp-codec-sbc.c index c90eb1936..45dc3ba52 100644 --- a/spa/plugins/bluez5/a2dp-codec-sbc.c +++ b/spa/plugins/bluez5/a2dp-codec-sbc.c @@ -584,7 +584,7 @@ static int codec_start_encode (void *data, this->payload->frame_count = 0; this->header->v = 2; - this->header->pt = 1; + this->header->pt = 96; this->header->sequence_number = htons(seqnum); this->header->timestamp = htonl(timestamp); this->header->ssrc = htonl(1);