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

Order of media formats not preserved #1158

Closed
singpolyma opened this issue Apr 11, 2024 · 2 comments · Fixed by #1168
Closed

Order of media formats not preserved #1158

singpolyma opened this issue Apr 11, 2024 · 2 comments · Fixed by #1168

Comments

@singpolyma
Copy link
Contributor

When I call:

description.addOpucCodec(107);
description.addPCMUCodec(0);

I expect my m-line to contain formats in the order 107 0 so that I express that I prefer to use opus rather than PCMU when both are available. But

for (auto it = mRtpMaps.begin(); it != mRtpMaps.end(); ++it)
which generates this list pulls from a std::map which orders by key, and the payloadType is the key, so it ends up putting 0 first and PCMU wins.

Using 0 because it is the standard payloadType for PCMU https://en.wikipedia.org/wiki/RTP_payload_formats

@paullouisageneau
Copy link
Owner

Indeed currently order is not preserved. This was already mentioned by @wusspuss in #1142 with a proposed fix in #1144, however it's not finished and would break things as it is.

@paullouisageneau
Copy link
Owner

Fixed by #1168

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

Successfully merging a pull request may close this issue.

2 participants