Do not create receiver for ealy media in offerer

For offerer, if the remote side sends early media
before the remote description (answer) is received,
the undeclared SSRC processor can create a receiver
and that receiver could be left dangling as
transceiver `mid` is not updated from remote
description answer.

Still leaving the simulcast probe path and only
avoiding creating a receiver for non-simulcast path.

Add a flag `handleUndeclaredSSRCWithoutAnswer` to control handling
of early media without SDP answer for non-simulcast tracks.
The default behaviour is to not process early media without SDP answer.
This commit is contained in:
boks1971
2025-08-21 14:19:06 +05:30
committed by Raja Subramanian
parent 29e1e00639
commit 8efd17e592
3 changed files with 22 additions and 4 deletions

View File

@@ -109,6 +109,7 @@ type SettingEngine struct {
fireOnTrackBeforeFirstRTP bool
disableCloseByDTLS bool
dataChannelBlockWrite bool
handleUndeclaredSSRCWithoutAnswer bool
}
func (e *SettingEngine) getSCTPMaxMessageSize() uint32 {
@@ -570,3 +571,9 @@ func (e *SettingEngine) SetFireOnTrackBeforeFirstRTP(fireOnTrackBeforeFirstRTP b
func (e *SettingEngine) DisableCloseByDTLS(isEnabled bool) {
e.disableCloseByDTLS = isEnabled
}
// SetHandleUndeclaredSSRCWithoutAnswer controls if an SDP answer is required for
// processing early media of non-simulcast tracks.
func (e *SettingEngine) SetHandleUndeclaredSSRCWithoutAnswer(handleUndeclaredSSRCWithoutAnswer bool) {
e.handleUndeclaredSSRCWithoutAnswer = handleUndeclaredSSRCWithoutAnswer
}