Skip to content

Commit

Permalink
Remove unused ClockRate parameter.
Browse files Browse the repository at this point in the history
This parameter doesn't appear to be used anywhere.
  • Loading branch information
kevmo314 committed Dec 8, 2021
1 parent 9c94cc0 commit 48e8ade
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Hugo Arregui <hugo@decentraland.org>
John Bradley <jrb@turrettech.com>
Juliusz Chroboczek <jch@irif.fr>
Kazuyuki Honda <hakobera@gmail.com>
Kevin Wang <kevmo314@gmail.com>
Luke Curley <kixelated@gmail.com>
lxb <xiangbing.li@uama.com.cn>
Michael MacDonald <github@macdonald.cx>
Expand Down
4 changes: 1 addition & 3 deletions packetizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,21 @@ type packetizer struct {
Payloader Payloader
Sequencer Sequencer
Timestamp uint32
ClockRate uint32
extensionNumbers struct { // put extension numbers in here. If they're 0, the extension is disabled (0 is not a legal extension number)
AbsSendTime int // http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
}
timegen func() time.Time
}

// NewPacketizer returns a new instance of a Packetizer for a specific payloader
func NewPacketizer(mtu uint16, pt uint8, ssrc uint32, payloader Payloader, sequencer Sequencer, clockRate uint32) Packetizer {
func NewPacketizer(mtu uint16, pt uint8, ssrc uint32, payloader Payloader, sequencer Sequencer) Packetizer {
return &packetizer{
MTU: mtu,
PayloadType: pt,
SSRC: ssrc,
Payloader: payloader,
Sequencer: sequencer,
Timestamp: globalMathRandomGenerator.Uint32(),
ClockRate: clockRate,
timegen: time.Now,
}
}
Expand Down
4 changes: 2 additions & 2 deletions packetizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
func TestPacketizer(t *testing.T) {
multiplepayload := make([]byte, 128)
// use the G722 payloader here, because it's very simple and all 0s is valid G722 data.
packetizer := NewPacketizer(100, 98, 0x1234ABCD, &codecs.G722Payloader{}, NewRandomSequencer(), 90000)
packetizer := NewPacketizer(100, 98, 0x1234ABCD, &codecs.G722Payloader{}, NewRandomSequencer())
packets := packetizer.Packetize(multiplepayload, 2000)

if len(packets) != 2 {
Expand All @@ -26,7 +26,7 @@ func TestPacketizer(t *testing.T) {

func TestPacketizer_AbsSendTime(t *testing.T) {
// use the G722 payloader here, because it's very simple and all 0s is valid G722 data.
pktizer := NewPacketizer(100, 98, 0x1234ABCD, &codecs.G722Payloader{}, NewFixedSequencer(1234), 90000)
pktizer := NewPacketizer(100, 98, 0x1234ABCD, &codecs.G722Payloader{}, NewFixedSequencer(1234))
pktizer.(*packetizer).Timestamp = 45678
pktizer.(*packetizer).timegen = func() time.Time {
return time.Date(1985, time.June, 23, 4, 0, 0, 0, time.FixedZone("UTC-5", -5*60*60))
Expand Down

0 comments on commit 48e8ade

Please sign in to comment.