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

Commit

Permalink
Merge pull request #13 from kz26/master
Browse files Browse the repository at this point in the history
Fix EXT-X-PLAYLIST-TYPE parsing
  • Loading branch information
grafov committed Nov 9, 2014
2 parents e67b026 + e50ea99 commit 007a2bf
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,19 @@ func decodeLineOfMediaPlaylist(p *MediaPlaylist, wv *WV, state *decodingState, l
}
case strings.HasPrefix(line, "#EXT-X-PLAYLIST-TYPE:"):
state.listType = MEDIA
if _, err = fmt.Sscanf(line, "#EXT-X-PLAYLIST-TYPE:%s", &p.MediaType); strict && err != nil {
return err
var playlistType string
_, err = fmt.Sscanf(line, "#EXT-X-PLAYLIST-TYPE:%s", &playlistType)
if err != nil {
if strict {
return err
}
} else {
switch playlistType {
case "EVENT":
p.MediaType = EVENT
case "VOD":
p.MediaType = VOD
}
}
case strings.HasPrefix(line, "#EXT-X-KEY:"):
state.listType = MEDIA
Expand Down

0 comments on commit 007a2bf

Please sign in to comment.