Title: [214108] trunk
Revision
214108
Author
[email protected]
Date
2017-03-17 10:16:51 -0700 (Fri, 17 Mar 2017)

Log Message

RealtimeIncomingAudioSource is not stopping properly
https://bugs.webkit.org/show_bug.cgi?id=169807

Patch by Youenn Fablet <[email protected]> on 2017-03-17
Reviewed by Eric Carlson.

Source/WebCore:

Test: webrtc/release-after-getting-track.html

* platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::~RealtimeIncomingAudioSource):
(WebCore::RealtimeIncomingAudioSource::stopProducingData):

LayoutTests:

* webrtc/release-after-getting-track-expected.txt: Added.
* webrtc/release-after-getting-track.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (214107 => 214108)


--- trunk/LayoutTests/ChangeLog	2017-03-17 17:09:00 UTC (rev 214107)
+++ trunk/LayoutTests/ChangeLog	2017-03-17 17:16:51 UTC (rev 214108)
@@ -1,3 +1,13 @@
+2017-03-17  Youenn Fablet  <[email protected]>
+
+        RealtimeIncomingAudioSource is not stopping properly
+        https://bugs.webkit.org/show_bug.cgi?id=169807
+
+        Reviewed by Eric Carlson.
+
+        * webrtc/release-after-getting-track-expected.txt: Added.
+        * webrtc/release-after-getting-track.html: Added.
+
 2017-03-17  Miguel Gomez  <[email protected]>
 
         Follow-up (r213833): write a layout test for 169199

Added: trunk/LayoutTests/webrtc/release-after-getting-track-expected.txt (0 => 214108)


--- trunk/LayoutTests/webrtc/release-after-getting-track-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webrtc/release-after-getting-track-expected.txt	2017-03-17 17:16:51 UTC (rev 214108)
@@ -0,0 +1,3 @@
+
+PASS Ensuring collecting tracks does not lead to crashing 
+

Added: trunk/LayoutTests/webrtc/release-after-getting-track.html (0 => 214108)


--- trunk/LayoutTests/webrtc/release-after-getting-track.html	                        (rev 0)
+++ trunk/LayoutTests/webrtc/release-after-getting-track.html	2017-03-17 17:16:51 UTC (rev 214108)
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+    <head>
+        <meta charset="utf-8">
+        <title>Testing garbage collection after getting tracks</title>
+        <script src=""
+        <script src=""
+    </head>
+    <body>
+        <script src =""
+        <script>
+promise_test((test) => {
+    if (window.testRunner)
+        testRunner.setUserMediaPermission(true);
+
+    return navigator.mediaDevices.getUserMedia({ video: true, audio: true}).then((stream) => {
+        return new Promise((resolve, reject) => {
+            if (window.internals)
+                internals.useMockRTCPeerConnectionFactory("TwoRealPeerConnections");
+
+            createConnections((firstConnection) => {
+                firstConnection.addStream(stream);
+            }, (secondConnection) => {
+                secondConnection._ontrack_ = resolve;
+            });
+            setTimeout(() => reject("Test timed out"), 5000);
+        });
+    }).then(() => {
+        if (window.GCController)
+            window.GCController.collect();
+        waitFor(1000);
+    });
+}, "Ensuring collecting tracks does not lead to crashing");
+        </script>
+    </body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (214107 => 214108)


--- trunk/Source/WebCore/ChangeLog	2017-03-17 17:09:00 UTC (rev 214107)
+++ trunk/Source/WebCore/ChangeLog	2017-03-17 17:16:51 UTC (rev 214108)
@@ -1,3 +1,16 @@
+2017-03-17  Youenn Fablet  <[email protected]>
+
+        RealtimeIncomingAudioSource is not stopping properly
+        https://bugs.webkit.org/show_bug.cgi?id=169807
+
+        Reviewed by Eric Carlson.
+
+        Test: webrtc/release-after-getting-track.html
+
+        * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
+        (WebCore::RealtimeIncomingAudioSource::~RealtimeIncomingAudioSource):
+        (WebCore::RealtimeIncomingAudioSource::stopProducingData):
+
 2017-03-16  Alex Christensen  <[email protected]>
 
         Use completion handlers instead of return values for sending websocket data

Modified: trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.cpp (214107 => 214108)


--- trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.cpp	2017-03-17 17:09:00 UTC (rev 214107)
+++ trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.cpp	2017-03-17 17:16:51 UTC (rev 214108)
@@ -63,6 +63,7 @@
         m_audioSourceProvider->unprepare();
         m_audioSourceProvider = nullptr;
     }
+    stopProducingData();
 }
 
 
@@ -121,7 +122,7 @@
 
 void RealtimeIncomingAudioSource::stopProducingData()
 {
-    if (m_isProducingData)
+    if (!m_isProducingData)
         return;
 
     m_isProducingData = false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to