@@ -906,12 +906,14 @@ extension MSRPApplication {
906906 accumulatedLatency += 500 // clause 35.2.2.8.6, 500ns default
907907 }
908908
909+ let complementToRemove : MSRPAttributeType =
910+ declarationType == . talkerAdvertise ? . talkerFailed : . talkerAdvertise
911+ try await participant. leaveNow { attributeType, _, attributeValue in
912+ attributeType == complementToRemove. rawValue &&
913+ ( attributeValue as! MSRPStreamIDRepresentable ) . streamID == talkerValue. streamID
914+ }
915+
909916 if declarationType == . talkerAdvertise {
910- // Leave any existing talkerFailed before joining talkerAdvertise
911- try await participant. leaveNow { attributeType, _, attributeValue in
912- attributeType == MSRPAttributeType . talkerFailed. rawValue &&
913- ( attributeValue as! MSRPStreamIDRepresentable ) . streamID == talkerValue. streamID
914- }
915917 do {
916918 try await _canBridgeTalker (
917919 participant: participant,
@@ -970,11 +972,6 @@ extension MSRPApplication {
970972 }
971973 } else {
972974 precondition ( declarationType == . talkerFailed)
973- // Leave any existing talkerAdvertise before joining talkerFailed
974- try await participant. leaveNow { attributeType, _, attributeValue in
975- attributeType == MSRPAttributeType . talkerAdvertise. rawValue &&
976- ( attributeValue as! MSRPStreamIDRepresentable ) . streamID == talkerValue. streamID
977- }
978975 let talkerFailed = MSRPTalkerFailedValue (
979976 streamID: talkerValue. streamID,
980977 dataFrameParameters: talkerValue. dataFrameParameters,
0 commit comments