commit - 8d2c4bc42dfbbe01d8d7cfd968ca60c8048ae6f9
commit + 96a874b067dad9a5704171d9c63a5594b6d42e3d
blob - 7900cc1839e80e544e72c0a1bb5d1c794428cb06
blob + 5313912265ce515dae4646ee4ad514b2c8b77bf3
--- sdp/encode.go
+++ sdp/encode.go
fmt.Fprintln(buf, s.Bandwidth)
}
- // TODO(otl): what about the invalid case where Time[0] is zero but Time[1] is not?
if s.Time[0].IsZero() {
fmt.Fprintln(buf, "t=0 0")
} else {
blob - a1c8a7a3ba48919af7f7b89a81dcf3a3d65f9c4a
blob + 70284b62ddfaf49a11b2ad016a4eb0701a6be5bf
--- sdp/parser.go
+++ sdp/parser.go
*bufio.Scanner
err error
// Field name and value from the current line.
- // TODO(otl): rename? key, value is very non-specific...
key, value string
next []string // expected next field names
blob - a585ba049e5f2a655641d29db9b5200b753e2d85
blob + a80d57737405406ce3d79c7ec9bb6dc5fc4787ca
--- sdp/sdp.go
+++ sdp/sdp.go
if !ok {
return Bandwidth{}, fmt.Errorf("missing %s separator", ":")
}
- // TODO(otl): check bandwith type is actually one specified in section 5.8.
if t == "" {
return Bandwidth{}, fmt.Errorf("missing bandwidth type")
}
Title string
Connection *ConnInfo
Bandwidth *Bandwidth
- // TODO(otl): store as k, v pairs
Attributes []string
}
// ConnInfo represents connection information.
type ConnInfo struct {
Address netip.Addr
- // TODO(otl): what are these units? seconds?
- TTL uint8 // time to live
- Count int // number of addresses after Address
+ // TTL is the time-to-live of multicast packets.
+ TTL uint8
+ // Count is the number of subsequent IP addresses after
+ // Address used in the session.
+ Count int
}
func (c *ConnInfo) String() string {
blob - c6c55c1a7bedffe093c5c07461db4861f9bf6d2a
blob + 7e78b08c0e3145e90872e89926f38dff6dbacc35
--- sdp/time.go
+++ sdp/time.go
import (
"errors"
"fmt"
+ "math"
"strconv"
"strings"
"time"
}
func (rp *Repeat) String() string {
- // TODO(otl): print with no decimal places?
- s := fmt.Sprintf("r=%f %f ", rp.Interval.Round(time.Second).Seconds(), rp.Active.Round(time.Second).Seconds())
+ interval := math.Round(rp.Interval.Round(time.Second).Seconds())
+ active := math.Round(rp.Active.Round(time.Second).Seconds())
+ s := fmt.Sprintf("r=%d %d ", int(interval), int(active))
if len(rp.Offsets) > 0 {
ss := make([]string, len(rp.Offsets))
for i := range rp.Offsets {