diff --git a/reader.go b/reader.go index 243a10d1..10d997c0 100644 --- a/reader.go +++ b/reader.go @@ -511,10 +511,16 @@ func decodeLineOfMediaPlaylist(p *MediaPlaylist, wv *WV, state *decodingState, l state.tagInf = true state.listType = MEDIA params := strings.SplitN(line[8:], ",", 2) - if state.duration, err = strconv.ParseFloat(params[0], 64); strict && err != nil { - return fmt.Errorf("Duration parsing error: %s", err) + if len(params) > 0 { + if state.duration, err = strconv.ParseFloat(params[0], 64); strict && err != nil { + return fmt.Errorf("Duration parsing error: %s", err) + } + } + if len(params) > 1 { + title = params[1] + } else { + title = "" } - title = params[1] case !state.tagDiscontinuity && strings.HasPrefix(line, "#EXT-X-DISCONTINUITY"): state.tagDiscontinuity = true state.listType = MEDIA