Cleanup AudioTrackPrivateMediaStreamCocoa
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Jan 2019 22:39:18 +0000 (22:39 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Jan 2019 22:39:18 +0000 (22:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193208
<rdar://problem/42225870>

Reviewed by Youenn Fablet.

* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable): Clear input and
output format descriptions after stopping the audio unit.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp

index 42b7d6d..3ffa14c 100644 (file)
@@ -1,3 +1,15 @@
+2019-01-07  Eric Carlson  <eric.carlson@apple.com>
+
+        Cleanup AudioTrackPrivateMediaStreamCocoa
+        https://bugs.webkit.org/show_bug.cgi?id=193208
+        <rdar://problem/42225870>
+
+        Reviewed by Youenn Fablet.
+
+        * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
+        (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable): Clear input and
+        output format descriptions after stopping the audio unit.
+
 2019-01-07  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Network: show secure connection details per-request
index 478718a..902b0bb 100644 (file)
@@ -172,15 +172,15 @@ void AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable(const MediaTime& s
 
     if (!m_inputDescription || *m_inputDescription != description) {
 
-        m_inputDescription = nullptr;
-        m_outputDescription = nullptr;
-
         if (m_remoteIOUnit) {
             AudioOutputUnitStop(m_remoteIOUnit);
             AudioComponentInstanceDispose(m_remoteIOUnit);
             m_remoteIOUnit = nullptr;
         }
 
+        m_inputDescription = nullptr;
+        m_outputDescription = nullptr;
+
         CAAudioStreamDescription inputDescription = toCAAudioStreamDescription(description);
         CAAudioStreamDescription outputDescription;