mirror of
https://github.com/yattee/yattee.git
synced 2025-11-20 17:02:21 +00:00
Fix nil crash when accessing stream.format
This commit addresses crashes caused by accessing nil format values on streams: - QualityProfile.swift: Add guard check for stream.format to prevent nil access crash - MPVBackend.swift: Add nil check in canPlay method before comparing format - PlayerStreams.swift: Add nil check before comparing format in asset processing The crashes occurred when stream.format was nil and accessed as an implicitly unwrapped optional, causing "Unexpectedly found nil while implicitly unwrapping an Optional value" errors.
This commit is contained in:
@@ -73,7 +73,7 @@ extension PlayerModel {
|
||||
for stream in streams {
|
||||
streamProcessingQueue.async(group: streamProcessingGroup) {
|
||||
let forbiddenAssetTestGroup = DispatchGroup()
|
||||
if !hasAllowedAsset, !hasForbiddenAsset, !instance.proxiesVideos, stream.format != Stream.Format.unknown {
|
||||
if !hasAllowedAsset, !hasForbiddenAsset, !instance.proxiesVideos, stream.format != nil && stream.format != Stream.Format.unknown {
|
||||
let (nonHLSAssets, hlsURLs) = self.getAssets(from: [stream])
|
||||
if let firstStream = nonHLSAssets.first {
|
||||
let asset = firstStream.0
|
||||
|
||||
Reference in New Issue
Block a user