From 154f828d6a2cb3dae1a553c53529080a0891a2f7 Mon Sep 17 00:00:00 2001 From: kingslay Date: Thu, 23 Nov 2023 22:48:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/KSPlayer/AVPlayer/KSOptions.swift | 3 ++- Sources/KSPlayer/MEPlayer/MEPlayerItem.swift | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/KSPlayer/AVPlayer/KSOptions.swift b/Sources/KSPlayer/AVPlayer/KSOptions.swift index 29381e8d4..4bebd7caa 100644 --- a/Sources/KSPlayer/AVPlayer/KSOptions.swift +++ b/Sources/KSPlayer/AVPlayer/KSOptions.swift @@ -110,6 +110,7 @@ open class KSOptions { formatContextOptions["scan_all_pmts"] = 1 formatContextOptions["auto_convert"] = 0 formatContextOptions["fps_probe_size"] = 3 + formatContextOptions["protocol_whitelist"] = "file,http,https,tcp,tls,crypto,async,cache" // formatContextOptions["max_analyze_duration"] = 300 * 1000 formatContextOptions["reconnect"] = 1 // 开启这个,纯ipv6地址会无法播放。 @@ -250,7 +251,7 @@ open class KSOptions { display == .plane } - open func io(log: String) { + open func urlIO(log: String) { if log.starts(with: "Original list of addresses"), dnsStartTime == 0 { dnsStartTime = CACurrentMediaTime() } else if log.starts(with: "Starting connection attempt to"), tcpStartTime == 0 { diff --git a/Sources/KSPlayer/MEPlayer/MEPlayerItem.swift b/Sources/KSPlayer/MEPlayer/MEPlayerItem.swift index bd19c3e92..23bbcef8a 100644 --- a/Sources/KSPlayer/MEPlayer/MEPlayerItem.swift +++ b/Sources/KSPlayer/MEPlayer/MEPlayerItem.swift @@ -107,7 +107,7 @@ final class MEPlayerItem { let context = ptr.assumingMemoryBound(to: URLContext.self).pointee if let opaque = context.interrupt_callback.opaque { let playerItem = Unmanaged.fromOpaque(opaque).takeUnretainedValue() - playerItem.options.io(log: log) + playerItem.options.urlIO(log: String(log)) if log.starts(with: "Will reconnect at") { let seconds = playerItem.mainClock().positionTime.seconds playerItem.videoTrack?.seekTime = seconds