From 48e8adefbf5e5d5a7e6965df9d6831f7769a085c Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Wed, 8 Dec 2021 07:55:25 -0500 Subject: [PATCH] Remove unused ClockRate parameter. This parameter doesn't appear to be used anywhere. --- AUTHORS.txt | 1 + packetizer.go | 4 +--- packetizer_test.go | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/AUTHORS.txt b/AUTHORS.txt index 809e85c..e44a836 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -19,6 +19,7 @@ Hugo Arregui John Bradley Juliusz Chroboczek Kazuyuki Honda +Kevin Wang Luke Curley lxb Michael MacDonald diff --git a/packetizer.go b/packetizer.go index 19f6c75..dbf85ff 100644 --- a/packetizer.go +++ b/packetizer.go @@ -23,7 +23,6 @@ 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 } @@ -31,7 +30,7 @@ type packetizer struct { } // 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, @@ -39,7 +38,6 @@ func NewPacketizer(mtu uint16, pt uint8, ssrc uint32, payloader Payloader, seque Payloader: payloader, Sequencer: sequencer, Timestamp: globalMathRandomGenerator.Uint32(), - ClockRate: clockRate, timegen: time.Now, } } diff --git a/packetizer_test.go b/packetizer_test.go index 1a4e307..ed4b726 100644 --- a/packetizer_test.go +++ b/packetizer_test.go @@ -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 { @@ -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))