This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension CMTime: Codable { | |
public init(from decoder: Decoder) throws { | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
self.value = try container.decode(CMTimeValue.self, forKey: .value) | |
self.timescale = try container.decode(CMTimeScale.self, forKey: .timescale) | |
self.flags = CMTimeFlags(rawValue: try container.decode(UInt32.self, forKey: .flags)) | |
self.epoch = try container.decode(CMTimeEpoch.self, forKey: .epoch) | |
} |