stream: fix firefox datachannel readiness counting#9
Open
kfatehi wants to merge 1 commit intocommaai:masterfrom
Open
stream: fix firefox datachannel readiness counting#9kfatehi wants to merge 1 commit intocommaai:masterfrom
kfatehi wants to merge 1 commit intocommaai:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I used an AI assistant to help trace this, then verified and tested the fix manually.
Fixes a Firefox-specific readiness bug in
WebRTCBaseStream._parse_incoming_streamsthat prevented messaging (e.g. joystick commands) from being set up.Root cause
expected_number_of_incoming_mediawas over-counted when SDP included a datachannel media section (m=application) witha=sendrecv(common in Firefox).The parser counted that application media twice:
sendonly/sendrecvmedia countm.kind == "application") countThat made
expected_number_of_incoming_medialarger than the actual runtime media/events, so readiness never completed.Fix
audioandvideoonly.int(len(channel_medias) > 0)), avoiding double-counting.Behavior
Tests
test_parse_incoming_streams_datachannel_not_double_countedPYTHONPATH=. pytest -q -o addopts='' tests/test_stream.py -k datachannel_not_double_counted1 passed