MT#66417 codec_add_dtmf_packet: add room for the header extension

A fix-up for 4fbef394
Since that commit, the printer adds the `mid` from the egress media
extmap even when the input had none and the older bug (with the missing
room in `codec_add_dtmf_packet()`) started corrupting packets.

Just reserve the extension room in the same way the `codec_add_raw_packet_dup()`
and the `packet_encoded_packetize()` already do.

An example of bug triggered: chrome sending the DTMF with no extensions.

Change-Id: I87a61e1f87e896609e76bbdf87b4c7827027f39d
(cherry picked from commit f950a9f7be)
mr26.0
Donat Zenichev 2 weeks ago
parent 94e5ff639d
commit b05488fd5d

@ -2654,9 +2654,10 @@ static int codec_add_dtmf_packet(struct codec_ssrc_handler *ch, struct codec_ssr
skip:
ssrc_entry_release(output_ch);
size_t ext_len = mp->sink.rtpext->length(mp);
char *buf = bufferpool_alloc(media_bufferpool,
packet->payload->len + sizeof(struct rtp_header) + RTP_BUFFER_TAIL_ROOM);
memcpy(buf + sizeof(struct rtp_header), packet->payload->s, packet->payload->len);
packet->payload->len + sizeof(struct rtp_header) + ext_len + RTP_BUFFER_TAIL_ROOM);
memcpy(buf + sizeof(struct rtp_header) + ext_len, packet->payload->s, packet->payload->len);
if (packet->bypass_seq) // inject original seq
codec_output_rtp(mp, &ch->csch, packet->handler ? : h, buf, packet->payload->len, packet->ts,
(struct rtp_markers) { .marker = packet->marker },

Loading…
Cancel
Save