mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 15:48:05 +00:00
fix(mpv-player): resolve swift compiler warnings
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
class Logger {
|
||||
final class Logger: @unchecked Sendable {
|
||||
static let shared = Logger()
|
||||
|
||||
struct LogEntry {
|
||||
|
||||
@@ -98,13 +98,6 @@ final class MPVLayerRenderer {
|
||||
checkError(mpv_request_log_messages(handle, "no"))
|
||||
#endif
|
||||
|
||||
// Detect if running on simulator
|
||||
#if targetEnvironment(simulator)
|
||||
let isSimulator = true
|
||||
#else
|
||||
let isSimulator = false
|
||||
#endif
|
||||
|
||||
// Pass the AVSampleBufferDisplayLayer to mpv via --wid
|
||||
// The vo_avfoundation driver expects this
|
||||
let layerPtrInt = Int(bitPattern: Unmanaged.passUnretained(displayLayer).toOpaque())
|
||||
@@ -121,8 +114,11 @@ final class MPVLayerRenderer {
|
||||
// Hardware decoding with VideoToolbox
|
||||
// On simulator, use software decoding since VideoToolbox is not available
|
||||
// On device, use VideoToolbox with software fallback enabled
|
||||
let hwdecValue = isSimulator ? "no" : "videotoolbox"
|
||||
checkError(mpv_set_option_string(handle, "hwdec", hwdecValue))
|
||||
#if targetEnvironment(simulator)
|
||||
checkError(mpv_set_option_string(handle, "hwdec", "no"))
|
||||
#else
|
||||
checkError(mpv_set_option_string(handle, "hwdec", "videotoolbox"))
|
||||
#endif
|
||||
checkError(mpv_set_option_string(handle, "hwdec-codecs", "all"))
|
||||
checkError(mpv_set_option_string(handle, "hwdec-software-fallback", "yes"))
|
||||
|
||||
@@ -306,6 +302,7 @@ final class MPVLayerRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
private func commandSync(_ handle: OpaquePointer, _ args: [String]) -> Int32 {
|
||||
guard !args.isEmpty else { return -1 }
|
||||
return withCStringArray(args) { pointer in
|
||||
|
||||
Reference in New Issue
Block a user