Index: webrtc/examples/objc/AppRTCDemo/ARDAppClient.m |
diff --git a/webrtc/examples/objc/AppRTCDemo/ARDAppClient.m b/webrtc/examples/objc/AppRTCDemo/ARDAppClient.m |
index 43eb6f4ad2fff30c4534ec9bea438b015c6d890e..88431c6562d18682891377aef9d34f628965cb78 100644 |
--- a/webrtc/examples/objc/AppRTCDemo/ARDAppClient.m |
+++ b/webrtc/examples/objc/AppRTCDemo/ARDAppClient.m |
@@ -308,13 +308,11 @@ |
_isInitiator = NO; |
_hasReceivedSdp = NO; |
_messageQueue = [NSMutableArray array]; |
-#if defined(WEBRTC_IOS) |
- [_peerConnection stopRtcEventLog]; |
-#endif |
_peerConnection = nil; |
self.state = kARDAppClientStateDisconnected; |
#if defined(WEBRTC_IOS) |
RTCStopInternalCapture(); |
+ [_factory stopRtcEventLog]; |
#endif |
} |
@@ -527,6 +525,17 @@ |
return; |
} |
self.state = kARDAppClientStateConnected; |
+ |
+#if defined(WEBRTC_IOS) |
+ // Start event log. |
+ if (kARDAppClientEnableRtcEventLog) { |
+ NSString *filePath = [self documentsFilePathForFileName:@"webrtc-rtceventlog"]; |
+ if (![_factory startRtcEventLogWithFilePath:filePath |
+ maxSizeInBytes:kARDAppClientRtcEventLogMaxSizeInBytes]) { |
+ RTCLogError(@"Failed to start event logging."); |
+ } |
+ } |
+#endif |
// Create peer connection. |
RTCMediaConstraints *constraints = [self defaultPeerConnectionConstraints]; |
@@ -553,16 +562,6 @@ |
// Check if we've received an offer. |
[self drainMessageQueueIfReady]; |
} |
-#if defined(WEBRTC_IOS) |
- // Start event log. |
- if (kARDAppClientEnableRtcEventLog) { |
- NSString *filePath = [self documentsFilePathForFileName:@"webrtc-rtceventlog"]; |
- if (![_peerConnection startRtcEventLogWithFilePath:filePath |
- maxSizeInBytes:kARDAppClientRtcEventLogMaxSizeInBytes]) { |
- RTCLogError(@"Failed to start event logging."); |
- } |
- } |
-#endif |
} |
// Processes the messages that we've received from the room server and the |