diff --git a/stream/rtp/rtp.go b/stream/rtp/rtp.go index fa62d9fb..3d474647 100644 --- a/stream/rtp/rtp.go +++ b/stream/rtp/rtp.go @@ -26,8 +26,10 @@ LICENSE along with revid in gpl.txt. If not, see [GNU licenses](http://www.gnu.org/licenses). */ -// See https://tools.ietf.org/html/rfc6184 for rtp packet format - +/* +See https://tools.ietf.org/html/rfc6184 and https://tools.ietf.org/html/rfc3550 +for rtp-h264 and rtp standards. +*/ package rtp const ( @@ -88,6 +90,9 @@ func (p *Pkt) Bytes() []byte { buf[11] = byte(p.SSRC) buf = append(buf, p.Payload...) + // see https://tools.ietf.org/html/rfc3550 section 5.1 (padding). At end of + // rtp packet, padding may exist, with the last octet being the length of the + // padding including itself. if p.Padding != 0 { buf = buf[:cap(buf)] buf[len(buf)-1] = byte(p.Padding)