Backed out changeset 0593feead369 (bug 1294605)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 20 Oct 2016 20:03:16 +0200
changeset 427696 387012235302ccb073180d17ecea6e0d794dfcb3
parent 427695 b82347df2602f07c7b190f0fbf7a6991d6022044
child 427697 5a542246049e4ff7fc0c49234fdb49605047a8e2
push id33099
push userdholbert@mozilla.com
push dateThu, 20 Oct 2016 20:25:54 +0000
bugs1294605
milestone52.0a1
backs out0593feead369348ae725d5756bdfcb7d44429221
Backed out changeset 0593feead369 (bug 1294605)
dom/media/MediaStreamTrack.cpp
dom/media/MediaStreamTrack.h
--- a/dom/media/MediaStreamTrack.cpp
+++ b/dom/media/MediaStreamTrack.cpp
@@ -383,32 +383,16 @@ MediaStreamTrack::Clone()
   MediaStreamGraph* graph = Graph();
   newStream->InitOwnedStreamCommon(graph);
   newStream->InitPlaybackStreamCommon(graph);
 
   return newStream->CloneDOMTrack(*this, mTrackID);
 }
 
 void
-MediaStreamTrack::SetReadyState(MediaStreamTrackState aState)
-{
-  MOZ_ASSERT(!(mReadyState == MediaStreamTrackState::Ended &&
-               aState == MediaStreamTrackState::Live),
-             "We don't support overriding the ready state from ended to live");
-
-  if (mReadyState == MediaStreamTrackState::Live &&
-      aState == MediaStreamTrackState::Ended &&
-      mSource) {
-    mSource->UnregisterSink(this);
-  }
-
-  mReadyState = aState;
-}
-
-void
 MediaStreamTrack::NotifyEnded()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (Ended()) {
     return;
   }
 
--- a/dom/media/MediaStreamTrack.h
+++ b/dom/media/MediaStreamTrack.h
@@ -292,17 +292,17 @@ public:
    * Convenience (and legacy) method for when ready state is "ended".
    */
   bool Ended() const { return mReadyState == MediaStreamTrackState::Ended; }
 
   /**
    * Forces the ready state to a particular value, for instance when we're
    * cloning an already ended track.
    */
-  void SetReadyState(MediaStreamTrackState aState);
+  void SetReadyState(MediaStreamTrackState aState) { mReadyState = aState; }
 
   /**
    * Notified by the MediaStreamGraph, through our owning MediaStream on the
    * main thread.
    *
    * Note that this sets the track to ended and raises the "ended" event
    * synchronously.
    */