Comcast / mamba

Mamba is a Swift iOS, tvOS and macOS framework to parse, validate and write HTTP Live Streaming (HLS) data.
Apache License 2.0
178 stars 39 forks source link

playlist.tagIndexes(forMediaSequence:) is not working properly. #21

Closed dcoufal closed 6 years ago

dcoufal commented 6 years ago

Parse this variant:

#EXTM3U
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-TARGETDURATION:3
#EXT-X-VERSION:3
#EXTINF:2.96130,
fileSequence0.ts
#EXTINF:2.96130,
fileSequence1.ts
#EXTINF:2.96129,
fileSequence2.ts
#EXTINF:2.96129,
fileSequence3.ts
#EXTINF:2.96130,
fileSequence4.ts
#EXTINF:2.96130,
fileSequence5.ts
#EXTINF:2.96129,
fileSequence6.ts
#EXTINF:2.96129,
fileSequence7.ts
#EXTINF:2.96130,
fileSequence8.ts
#EXTINF:2.96130,
fileSequence9.ts
#EXTINF:2.96129,
fileSequence10.ts

Call playlist.tagIndexes(forMediaSequence: 0)

Expected Behavior

I would expect to get a range back (namely 4...5, I think, but there should be a range as that media sequence exists)

Observed Behavior

You get nil back.

Note that if you call playlist.segmentGroup(forMediaSequence: 0) you do get the correct structure back and that structure has the correct range, so this problem is likely trivial to fix.

Reproduction Steps

(steps are above)

Observed on device(s):

Observed on OS Version(s):

Notes:

Please add a unit test for this as part of the fix.

dcoufal commented 6 years ago

Fixed and merged.