Skip to content

Commit 6df7eca

Browse files
committed
fix: fix xros build
1 parent 99dad39 commit 6df7eca

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

Sources/BuildScripts/XCFrameworkBuild/main.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -462,14 +462,8 @@ private class BuildFFMPEG: BaseBuild {
462462
FileManager.default.createFile(atPath: lldbFile.path, contents: nil, attributes: nil)
463463
let path = directoryURL + "libavcodec/videotoolbox.c"
464464
if let data = FileManager.default.contents(atPath: path.path), var str = String(data: data, encoding: .utf8) {
465-
var lines = str.components(separatedBy: .newlines)
466-
for (index, line) in lines.enumerated() {
467-
if line.contains("kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey") {
468-
lines.insert(" CFDictionarySetValue(buffer_attributes, kCVPixelBufferMetalCompatibilityKey, kCFBooleanTrue);", at: index + 2)
469-
break
470-
}
471-
}
472-
str = lines.joined(separator: "\n")
465+
str = str.replacingOccurrences(of: "kCVPixelBufferOpenGLESCompatibilityKey", with: "kCVPixelBufferMetalCompatibilityKey")
466+
str = str.replacingOccurrences(of: "kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey", with: "kCVPixelBufferMetalCompatibilityKey")
473467
try? str.write(toFile: path.path, atomically: true, encoding: .utf8)
474468
}
475469
}

0 commit comments

Comments
 (0)