From 1afe365a16d6c87db086998122c7ab240750c0aa Mon Sep 17 00:00:00 2001 From: kintan Date: Fri, 24 May 2024 23:07:09 +0800 Subject: [PATCH] fix build --- .github/workflows/build.yml | 1 - Sources/KSPlayer/MEPlayer/Model.swift | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 383c6cf0..c4a11c14 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,6 @@ jobs: - uses: actions/checkout@main with: submodules: recursive - token: ${{ secrets.ACCESS_TOKEN }} # https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode - name: Set up Xcode run: | diff --git a/Sources/KSPlayer/MEPlayer/Model.swift b/Sources/KSPlayer/MEPlayer/Model.swift index c36b486f..241b58ea 100644 --- a/Sources/KSPlayer/MEPlayer/Model.swift +++ b/Sources/KSPlayer/MEPlayer/Model.swift @@ -302,7 +302,7 @@ public final class AudioFrame: MEFrame { case .pcmFormatInt16: let capacity = dataSize / MemoryLayout.size data[i]?.withMemoryRebound(to: Int16.self, capacity: capacity) { src in - var des = ContiguousArray.init(repeating: 0, count: Int(capacity)) + var des = ContiguousArray(repeating: 0, count: Int(capacity)) for j in 0 ..< capacity { des[j] = max(-1.0, min(Float(src[j]) / 32767.0, 1.0)) } @@ -311,7 +311,7 @@ public final class AudioFrame: MEFrame { case .pcmFormatInt32: let capacity = dataSize / MemoryLayout.size data[i]?.withMemoryRebound(to: Int32.self, capacity: capacity) { src in - var des = ContiguousArray.init(repeating: 0, count: Int(capacity)) + var des = ContiguousArray(repeating: 0, count: Int(capacity)) for j in 0 ..< capacity { des[j] = max(-1.0, min(Float(src[j]) / 2_147_483_647.0, 1.0)) } @@ -320,7 +320,7 @@ public final class AudioFrame: MEFrame { default: let capacity = dataSize / MemoryLayout.size data[i]?.withMemoryRebound(to: Float.self, capacity: capacity) { src in - var des = ContiguousArray.init(repeating: 0, count: Int(capacity)) + var des = ContiguousArray(repeating: 0, count: Int(capacity)) for j in 0 ..< capacity { des[j] = src[j] }