Repository: pion/rtp
Pull request #160 (2021-12-08 12:55:43)

Remove unused ClockRate parameter
This parameter doesn't appear to be used anywhere.

codecov[bot]: # [Codecov](https://codecov.io/gh/pion/rtp/pull/160?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion) Report
> Merging [#160](https://codecov.io/gh/pion/rtp/pull/160?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion) (5fdc220) into [master](https://codecov.io/gh/pion/rtp/commit/9c94cc0590762d4cca0e7b11509c9da94cb3a200?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion) (9c94cc0) will **decrease** coverage by `0.43%`.
> The diff coverage is `n/a`.

> :exclamation: Current head 5fdc220 differs from pull request most recent head 48e8ade. Consider uploading reports for the commit 48e8ade to get more accurate results
[![Impacted file tree graph](https://codecov.io/gh/pion/rtp/pull/160/graphs/tree.svg?width=650&height=150&src=pr&token=4KrbiBsspj&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion)](https://codecov.io/gh/pion/rtp/pull/160?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion)

```diff
@@            Coverage Diff             @@
##           master     #160      +/-   ##
==========================================
- Coverage   93.31%   92.87%   -0.44%     
==========================================
  Files          14       14              
  Lines         942      941       -1     
==========================================
- Hits          879      874       -5     
- Misses         45       49       +4     
  Partials       18       18              
```

| Flag | Coverage Δ | |
|---|---|---|
| go | `?` | |
| wasm | `92.87% <ø> (-0.01%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://codecov.io/gh/pion/rtp/pull/160?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion) | Coverage Δ | |
|---|---|---|
| [packetizer.go](https://codecov.io/gh/pion/rtp/pull/160/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion#diff-cGFja2V0aXplci5nbw==) | `80.55% <ø> (-0.53%)` | :arrow_down: |
| [packet.go](https://codecov.io/gh/pion/rtp/pull/160/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion#diff-cGFja2V0Lmdv) | `86.01% <0.00%> (-1.70%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pion/rtp/pull/160?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pion/rtp/pull/160?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion). Last update [9c94cc0...48e8ade](https://codecov.io/gh/pion/rtp/pull/160?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion).


Patch:
diff --git a/AUTHORS.txt b/AUTHORS.txt
index 809e85c..e44a836 100644
--- a/AUTHORS.txt
+++ b/AUTHORS.txt
@@ -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>
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,
 	}
 }


Test patch:
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))