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

Fixed broken switching when using different payload types in Streaming plugin #2692

Merged
merged 1 commit into from
Jun 14, 2021

Conversation

lminiero
Copy link
Member

This patch fixes a broken behaviour I discovered in the Streaming plugin when using the switching functionality. The plugin allows you to dynamically "switch" to a different mountpoint you subscribed to initially, assuming the same codecs are used: this can be used to easily "change channel" when using the Streaming plugin, without using a new PeerConnection or renegotiating the existing one (as far as the browser is concerned, it's the same stream, as the plugin will fix RTP headers to make the transition seamless).

This usually works nicely in both Streaming plugin and VideoRoom, but in the Streaming plugin this breaks if the mountpoint you're leaving and the one you're moving to don't use the same payload types. In that case, if e.g. you're expecting payload type X for VP8 because that's what subscribing to the first mountpoint offered you in the SDP, if the mountpoint you switch to uses payload type Y for VP8, then you'll start receiving RTP packets with payload type Y, and the browser will obviously ignore them and video will stop working, even though it's still VP8. This patch fixes this behaviour, by basically keeping track of which payload types were assigned to a subscriber PeerConnection, and overwrite payload types accordingly when sending that subscriber RTP packets no matter the source (old or new mountpoint).

Notice that this is only an issue in the Streaming plugin. The VideoRoom implements the feature differently (payload types are always overwritten, and are always the same for the same codec), and so is not affected.

@lminiero
Copy link
Member Author

Merging.

@lminiero lminiero merged commit f0b53b8 into master Jun 14, 2021
@lminiero lminiero deleted the switch-pt branch June 14, 2021 09:13
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 this pull request may close these issues.

None yet

1 participant