Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RegisterCodec can register two different codecs with same payload type #3015

Open
itzmanish opened this issue Jan 22, 2025 · 0 comments · May be fixed by #3016
Open

RegisterCodec can register two different codecs with same payload type #3015

itzmanish opened this issue Jan 22, 2025 · 0 comments · May be fixed by #3016

Comments

@itzmanish
Copy link
Contributor

itzmanish commented Jan 22, 2025

Your environment.

What did you do?

I added two different codecs with the same payload type and upon negotiation with the browser the browser threw Failed to parse SessionDescription. a=rtpmap:100 VP8/90000 Duplicate payload type with conflicting codec name or clock rate error.

What did you expect?

RegisterCodec should have returned an error and should not add codec with duplicate payload type.

What happened?

The addCodec method is called from updateFromRemoteDescription and RegisterCodec as well. The issue is if there are different codecs with the same payload type, for eg- 100 VP8 (Firefox) and 100 VP9 (Chrome), getting registered.

if c.MimeType == codec.MimeType && c.PayloadType == codec.PayloadType {
This line will treat them as different codecs and add both of them in codecs slice.
When the getCodecsByKind method is called during SDP generate for either answer or offer, both codecs will be included in SDP. Chrome throws an error Failed to parse SessionDescription. a=rtpmap:100 VP8/90000 Duplicate payload type with conflicting codec name or clock rate when it gets the same payload type with different codec information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant