pion / sdp

A Go implementation of the SDP
https://pion.ly/
MIT License
148 stars 56 forks source link

Fix GetCodecForPayloadType() with Alexa WebRTC #165

Closed aler9 closed 11 months ago

aler9 commented 11 months ago

Description

WebRTC offers from Alexa do not include the rtpmap attribute for payload types 0 and 8, and this makes GetCodecForPayloadType() return a fatal error. The current SDP specification (RFC8866) explicitly tells that rtpmap is not mandatory in case of these static payload types:

consider u-law PCM encoded single-channel audio sampled at 8 kHz. This is completely defined in the RTP audio/video profile as payload type 0, so there is no need for an "a=rtpmap:" attribute

This patch fixes the issue.

Reference issue

https://github.com/bluenviron/mediamtx/discussions/2539

codecov[bot] commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Files Coverage Δ
util.go 70.61% <100.00%> (+1.77%) :arrow_up:

:loudspeaker: Thoughts on this report? Let us know!.