Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
在使用
m3u8
进行播放时遇到崩溃通过调用栈定位到,因生成错误的
nodeIdentifier
而无法从mSegmentItems
中取到值,致item
为nil
。根据
NSNotFound
的定义得知,其实际上是NSInteger
的最大值:32
位系统上是2147483647
(0x7fffffff)64
位系统上是9223372036854775807
(0x7fffffffffffffff)所以
nodeIdentifier
中的9223372036854775807
是NSNotFound
,即此时的byteRange.length
为NSNotFound
。上方两个截图的情况:
byteRange.location
为NSNotFound
,一切正常byteRange.location
为0
,而byteRange.length
为NSNotFound
的情况,此时就会得到错误的nodeIdentifier
综上,本
PR
对generateSegmentNodeIdentifierWithIdentifier
进行完善,补充byteRange.length == NSNotFound
的判断,以此来解决崩溃问题。