Commit f3f32f9
authored
Fix SortMediaCapability offerer-priority track inversion (#1558)
The ternary in SetRemoteDescription selecting the priority-order key is
flipped relative to the comment above it ("The offerer gets to set the
codec priority"). The current code picks the answerer's track on both
branches:
- Receiving offer: uses LocalTrack (receiver is local; offerer is REMOTE)
- Receiving answer: uses RemoteTrack (answerer is remote; offerer is LOCAL)
Flipping the branches aligns behavior with the comment.
Symptom: two peers with identical multi-codec audio Capabilities
[Opus, PCMU, PCMA, G722] exchange offer/answer. OnAudioFormatsNegotiated
fires with PCMU 8kHz mono on the offerer and OPUS 48kHz stereo on the
answerer from the same negotiation. With this fix both land on Opus.1 parent 1080fa9 commit f3f32f9
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1218 | 1218 | | |
1219 | 1219 | | |
1220 | 1220 | | |
| 1221 | + | |
| 1222 | + | |
1221 | 1223 | | |
1222 | | - | |
| 1224 | + | |
1223 | 1225 | | |
1224 | 1226 | | |
1225 | 1227 | | |
| |||
0 commit comments