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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>25250</bug_id>
          
          <creation_ts>2014-04-03 17:18:08 +0000</creation_ts>
          <short_desc>Ended track should not be added to MediaStream, when addTrack() is invoked for and ended track.</short_desc>
          <delta_ts>2014-04-10 08:09:16 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebRTC Working Group</product>
          <component>Media Capture and Streams</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</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="Kiran">kiran.guduru</reporter>
          <assigned_to name="Adam Bergkvist">adam.bergkvist</assigned_to>
          <cc>kiran.guduru</cc>
    
    <cc>public-media-capture</cc>
    
    <cc>stefan.lk.hakansson</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>103363</commentid>
    <comment_count>0</comment_count>
    <who name="Kiran">kiran.guduru</who>
    <bug_when>2014-04-03 17:18:08 +0000</bug_when>
    <thetext>When section 4.2.3 [1] addTrack() is invoked, if that track is already ended, it should not be added to a MediaStream.

The steps for addTrack() should be modified as below to make it sync with 4.2 (Adding tracks when MediaStream constructor is invoked
&quot;If track has ended, then abort these steps and continue with the next track (if any).&quot;)


1. Let track be the MediaStreamTrack argument and stream this MediaStream object.

2. If track has ended, then abort these steps.

3. If track is already in stream&apos;s track set, then abort these steps.

4. Add track to stream&apos;s track set.

(step 2 is the newly added step).

[1] http://dev.w3.org/2011/webrtc/editor/getusermedia.html#dom-mediastreamtrack-enabled</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103391</commentid>
    <comment_count>1</comment_count>
    <who name="Kiran">kiran.guduru</who>
    <bug_when>2014-04-04 04:52:18 +0000</bug_when>
    <thetext>As per Martin comments [1], 

if the resolution is to remove the dependency of track state while adding a track to MediaStream, then the text in 4.2 of [2] should be changed by removing step-2
 
&quot;2. If track has ended, then abort these steps and continue with the next track (if any).&quot;

[1] http://lists.w3.org/Archives/Public/public-media-capture/2014Apr/0075.html
[2] http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediastream</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103395</commentid>
    <comment_count>2</comment_count>
    <who name="Stefan Hakansson LK">stefan.lk.hakansson</who>
    <bug_when>2014-04-04 07:21:57 +0000</bug_when>
    <thetext>Assigning to Adam (who has promised to do some bug fixing!).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103396</commentid>
    <comment_count>3</comment_count>
    <who name="Stefan Hakansson LK">stefan.lk.hakansson</who>
    <bug_when>2014-04-04 07:32:49 +0000</bug_when>
    <thetext>Already fixed in the current Ed&apos;s draft: http://dev.w3.org/2011/webrtc/editor/archives/20140321/getusermedia.html#methods</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103399</commentid>
    <comment_count>4</comment_count>
    <who name="Kiran">kiran.guduru</who>
    <bug_when>2014-04-04 07:59:10 +0000</bug_when>
    <thetext>addTrack() is upto mark but
Step 2 in MediaStream constructor(4.2 MediaStream)[1], which is specifying not to add ended track, is still present as shown below. 

Run the following sub steps for each MediaStreamTrack in the array:

1. Add track: Let track be the MediaStreamTrack about to be processed.

2. If track has ended, then abort these steps and continue with the next track (if any).

3. Add track to stream&apos;s track set.

Which is required to be removed (As per comment 2).

The new steps should be as follows (removing step 2).
1. Add track: Let track be the MediaStreamTrack about to be processed.

2. Add track to stream&apos;s track set.

[1] http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediastream</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103654</commentid>
    <comment_count>5</comment_count>
    <who name="Adam Bergkvist">adam.bergkvist</who>
    <bug_when>2014-04-10 07:57:24 +0000</bug_when>
    <thetext>I agree that we should stick with one approach here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103655</commentid>
    <comment_count>6</comment_count>
    <who name="Adam Bergkvist">adam.bergkvist</who>
    <bug_when>2014-04-10 08:09:16 +0000</bug_when>
    <thetext>Updated MediaStream() constructor as Kiran proposed.

https://github.com/fluffy/webrtc-w3c/commit/1b6070e125689b281ece573d7086ad153c8d28c6

Closing this bug as WONTFIX (since we&apos;re not fixing what the bug title says).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>