Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
kingslay committed May 24, 2024
1 parent 5cbaf5d commit 1afe365
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
6 changes: 3 additions & 3 deletions Sources/KSPlayer/MEPlayer/Model.swift
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public final class AudioFrame: MEFrame {
case .pcmFormatInt16:
let capacity = dataSize / MemoryLayout<Int16>.size
data[i]?.withMemoryRebound(to: Int16.self, capacity: capacity) { src in
var des = ContiguousArray<Float>.init(repeating: 0, count: Int(capacity))
var des = ContiguousArray<Float>(repeating: 0, count: Int(capacity))
for j in 0 ..< capacity {
des[j] = max(-1.0, min(Float(src[j]) / 32767.0, 1.0))
}
Expand All @@ -311,7 +311,7 @@ public final class AudioFrame: MEFrame {
case .pcmFormatInt32:
let capacity = dataSize / MemoryLayout<Int32>.size
data[i]?.withMemoryRebound(to: Int32.self, capacity: capacity) { src in
var des = ContiguousArray<Float>.init(repeating: 0, count: Int(capacity))
var des = ContiguousArray<Float>(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))
}
Expand All @@ -320,7 +320,7 @@ public final class AudioFrame: MEFrame {
default:
let capacity = dataSize / MemoryLayout<Float>.size
data[i]?.withMemoryRebound(to: Float.self, capacity: capacity) { src in
var des = ContiguousArray<Float>.init(repeating: 0, count: Int(capacity))
var des = ContiguousArray<Float>(repeating: 0, count: Int(capacity))
for j in 0 ..< capacity {
des[j] = src[j]
}
Expand Down

0 comments on commit 1afe365

Please sign in to comment.