From 4f6fc22f296b92cf2a48b857f0d8686adc744ef2 Mon Sep 17 00:00:00 2001 From: ThibaultBee <37510686+ThibaultBee@users.noreply.github.com> Date: Wed, 7 Feb 2024 11:06:43 +0100 Subject: [PATCH] fix(lib): dispatching connect seems to be slower --- Sources/ApiVideoLiveStream/ApiVideoLiveStream.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Sources/ApiVideoLiveStream/ApiVideoLiveStream.swift b/Sources/ApiVideoLiveStream/ApiVideoLiveStream.swift index 9ced1d2..3ef65bf 100644 --- a/Sources/ApiVideoLiveStream/ApiVideoLiveStream.swift +++ b/Sources/ApiVideoLiveStream/ApiVideoLiveStream.swift @@ -372,9 +372,7 @@ public class ApiVideoLiveStream { self.streamKey = streamKey self.url = url - self.rtmpStream.lockQueue.sync { - rtmpConnection.connect(url) - } + self.rtmpConnection.connect(url) } /// Stop your livestream @@ -432,9 +430,7 @@ public class ApiVideoLiveStream { private func rtmpErrorHandler(_ notification: Notification) { let e = Event.from(notification) print("rtmpErrorHandler: \(e)") - DispatchQueue.main.async { - self.rtmpConnection.connect(self.url) - } + self.rtmpConnection.connect(self.url) } #if os(iOS)