Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

SeqId is not set when parsing media playlist #107

Closed
thinkski opened this issue Jan 25, 2018 · 3 comments
Closed

SeqId is not set when parsing media playlist #107

thinkski opened this issue Jan 25, 2018 · 3 comments

Comments

@thinkski
Copy link

Upon decoding a media playlist, I expected SeqId of each segment to contain the sequence id of each segment. For example, if SeqNo of the playlist were 123 and it had three segments, I would expect the SeqId of the three segments to be 123, 124, and 125. However, they are all 0, regardless of SeqNo.

My current workaround it to populate the sequence ids after the fact myself:

pls, listType, err := m3u8.DecodeFrom(reader, true)

switch listType {
    case m3u8.MEDIA:
        // Cast to media playlist type
        mediapls := pls.(*m3u8.MediaPlaylist)

        // Populate segment sequence id from playlist sequence number
        for i, segment := range mediapls.Segments {
            if segment == nil {
                break
            }
            mediapls.Segments[i].SeqId = mediapls.SeqNo + uint64(i)
        }
        ...
@leikao
Copy link
Collaborator

leikao commented Jan 22, 2019

dup of #116

@thinkski
Copy link
Author

I would say the later issue is a duplicate of the earlier issue 😉 But glad to see the SeqId issue is being addressed.

@leikao
Copy link
Collaborator

leikao commented Jan 29, 2019

@thinkski I made a PR #124 to solve this issue, welcome to try it.

@leikao leikao closed this as completed in 1e6f30f Feb 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants