<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>195878</bug_id>
          
          <creation_ts>2019-03-18 02:42:10 -0700</creation_ts>
          <short_desc>RTCPeerConnection: removeTrack() renders subsequent addTrack() ineffective</short_desc>
          <delta_ts>2019-06-07 14:06:55 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebRTC</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.14</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Arne Gleditsch">argggh</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ben.browitt</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1517636</commentid>
    <comment_count>0</comment_count>
    <who name="Arne Gleditsch">argggh</who>
    <bug_when>2019-03-18 02:42:10 -0700</bug_when>
    <thetext>The offer sdp produced by RTCPeerConnection in Safari TP77 shows odd behavior when Plan B signalling is selected. The code at https://codepen.io/argggh/pen/ywEoLE, which essentially does ``addTrack(s1); removeTrack(addTrack(s2)); addTrack(s3);`` seems to never include information about the last track in the SDP produced by createOffer(). 

With Develop &gt; Experimental Features &gt; WebRTC Unified Plan enabled, the output looks like this:

    Tracks
    e5f95eb8-3431-47ec-b1fe-268500fccf81 / b207958a-16c9-435f-8054-04fb836bcfdb
    77de217a-af19-429f-8132-a4b3d858d27f / 3c4241fb-d540-484c-aea9-7795e8c1f91d
    c4625cbd-5e95-410c-ac26-e09ebc1d43e5 / 514367c2-0479-403d-9a06-3f81c7b7ad60

    SDP (add tracks 1 and 2)
    a=msid:e5f95eb8-3431-47ec-b1fe-268500fccf81 b207958a-16c9-435f-8054-04fb836bcfdb
    a=ssrc:3363836655 msid:e5f95eb8-3431-47ec-b1fe-268500fccf81 b207958a-16c9-435f-8054-04fb836bcfdb
    a=ssrc:2717606554 msid:e5f95eb8-3431-47ec-b1fe-268500fccf81 b207958a-16c9-435f-8054-04fb836bcfdb
    a=msid:77de217a-af19-429f-8132-a4b3d858d27f 3c4241fb-d540-484c-aea9-7795e8c1f91d
    a=ssrc:2879751916 msid:77de217a-af19-429f-8132-a4b3d858d27f 3c4241fb-d540-484c-aea9-7795e8c1f91d
    a=ssrc:2516360126 msid:77de217a-af19-429f-8132-a4b3d858d27f 3c4241fb-d540-484c-aea9-7795e8c1f91d

    SDP (remove track 2, add track 3)
    a=msid:e5f95eb8-3431-47ec-b1fe-268500fccf81 b207958a-16c9-435f-8054-04fb836bcfdb
    a=ssrc:1595518495 msid:e5f95eb8-3431-47ec-b1fe-268500fccf81 b207958a-16c9-435f-8054-04fb836bcfdb
    a=ssrc:1184215358 msid:e5f95eb8-3431-47ec-b1fe-268500fccf81 b207958a-16c9-435f-8054-04fb836bcfdb
    a=msid:c4625cbd-5e95-410c-ac26-e09ebc1d43e5 3c4241fb-d540-484c-aea9-7795e8c1f91d
    a=ssrc:3057393757 msid:c4625cbd-5e95-410c-ac26-e09ebc1d43e5 3c4241fb-d540-484c-aea9-7795e8c1f91d
    a=ssrc:3665793179 msid:c4625cbd-5e95-410c-ac26-e09ebc1d43e5 3c4241fb-d540-484c-aea9-7795e8c1f91d

however, when the Unified Plan is disabled, this is the result:

    Tracks
    12c56731-3e2d-4963-bf5c-aba54937cc26 / df2d5416-947b-4475-b0a4-a0d85fae51cf
    f8efb466-b232-437d-99fd-660632b21f15 / 171ff4e9-04ef-48f4-ab71-59644068ba25
    e56c1adb-e5bb-4dc6-87fd-1d154d90b1dd / f71f1a2a-ccf8-4f50-aa12-e99760b5f57f

    SDP (add tracks 1 and 2)
    a=ssrc:3446938118 msid:12c56731-3e2d-4963-bf5c-aba54937cc26 df2d5416-947b-4475-b0a4-a0d85fae51cf
    a=ssrc:3574411983 msid:12c56731-3e2d-4963-bf5c-aba54937cc26 df2d5416-947b-4475-b0a4-a0d85fae51cf
    a=ssrc:2997856108 msid:f8efb466-b232-437d-99fd-660632b21f15 171ff4e9-04ef-48f4-ab71-59644068ba25
    a=ssrc:3685245765 msid:f8efb466-b232-437d-99fd-660632b21f15 171ff4e9-04ef-48f4-ab71-59644068ba25

    SDP (remove track 2, add track 3)
    a=ssrc:304486373 msid:12c56731-3e2d-4963-bf5c-aba54937cc26 df2d5416-947b-4475-b0a4-a0d85fae51cf
    a=ssrc:297767829 msid:12c56731-3e2d-4963-bf5c-aba54937cc26 df2d5416-947b-4475-b0a4-a0d85fae51cf

As can be seen, track 3 is not mentioned in the offer SDP at all.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1532240</commentid>
    <comment_count>1</comment_count>
    <who name="Ben">ben.browitt</who>
    <bug_when>2019-05-02 03:23:51 -0700</bug_when>
    <thetext>Arne did you find a workaround to make the third track show in the SDP?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1542940</commentid>
    <comment_count>2</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2019-06-07 14:06:55 -0700</bug_when>
    <thetext>This should be fixed now that unified plan is on.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>