diff --git a/reader.go b/reader.go index 383f600e..55e9bb67 100644 --- a/reader.go +++ b/reader.go @@ -332,7 +332,7 @@ func decodeLineOfMasterPlaylist(p *MasterPlaylist, state *decodingState, line st case "CHANNELS": channels, err := strconv.Atoi(v) if err != nil { - return fmt.Errorf("non-integer value \"%s\" for CHANNELS attribute", v) + return fmt.Errorf("non-integer value %q for CHANNELS attribute", v) } alt.Channels = uint(channels) } diff --git a/writer.go b/writer.go index 399f0be0..96c08636 100644 --- a/writer.go +++ b/writer.go @@ -155,12 +155,12 @@ func (p *MasterPlaylist) Encode() *bytes.Buffer { p.buf.WriteString(alt.URI) p.buf.WriteRune('"') } - p.buf.WriteRune('\n') if alt.Channels != 0 { p.buf.WriteString(",CHANNELS=\"") p.buf.WriteString(strconv.FormatUint(uint64(alt.Channels), 10)) p.buf.WriteRune('"') } + p.buf.WriteRune('\n') } } if pl.Iframe {