Fix bug from r107672.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2012 20:10:51 +0000 (20:10 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2012 20:10:51 +0000 (20:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=78773

Before set MediaStreamTrack disable/enable operation,
checking the status of MediaStream that contains this MediaStreamTrack.
if MediaStream is finished, then skipping operation of
didSetMediaStreamTrackEnabled().

Patch by Lin Wei <wei.a.lin@intel.com> on 2012-02-21
Reviewed by Adam Barth.
* mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::setEnabled):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108383 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/mediastream/MediaStreamTrack.cpp

index 5b5c043..b67a3dd 100644 (file)
@@ -1,3 +1,17 @@
+2012-02-21  Lin Wei  <wei.a.lin@intel.com>
+
+        Fix bug from r107672.
+        https://bugs.webkit.org/show_bug.cgi?id=78773
+
+        Before set MediaStreamTrack disable/enable operation,
+        checking the status of MediaStream that contains this MediaStreamTrack.
+        if MediaStream is finished, then skipping operation of 
+        didSetMediaStreamTrackEnabled().
+
+        Reviewed by Adam Barth.
+        * mediastream/MediaStreamTrack.cpp:
+        (WebCore::MediaStreamTrack::setEnabled):
+
 2012-02-21  Julien Chaffraix  <jchaffraix@webkit.org>
 
         Move RenderLayer::scrolledContentOffset calls to a common function
index 4fb93ac..c34efa5 100644 (file)
@@ -81,6 +81,9 @@ void MediaStreamTrack::setEnabled(bool enabled)
 
     m_component->setEnabled(enabled);
 
+    if (m_streamDescriptor->ended())
+        return;    
+
     MediaStreamCenter::instance().didSetMediaStreamTrackEnabled(m_streamDescriptor.get(), m_component.get());
 }