mirror of
https://github.com/livekit/livekit.git
synced 2026-10-22 13:12:09 +00:00
Defer setting clock rate in RTPStats module till codec is bound. (#4250)
With audio simulcast codecs, it is possible that the clock rate of the primary codec is different from the secondary codec. If a subscriber binds to the secondary codec, the clock rate should be set correctly. Do it at bind time.
This commit is contained in:
1 parent
d9f716c14a
commit
aea044c5cb
8 files changed
+105
-65
No files matched your search
@@ -444,10 +444,9 @@ func (b *BufferBase) SetStreamRestartDetection(enable bool) {
|
||||
}
|
||||
|
||||
func (b *BufferBase) setupRTPStats(clockRate uint32) {
|
||||
b.rtpStats = rtpstats.NewRTPStatsReceiver(rtpstats.RTPStatsParams{
|
||||
ClockRate: clockRate,
|
||||
Logger: b.logger,
|
||||
})
|
||||
b.rtpStats = rtpstats.NewRTPStatsReceiver(rtpstats.RTPStatsParams{})
|
||||
b.rtpStats.SetClockRate(clockRate)
|
||||
|
||||
b.ppsSnapshotId = b.rtpStats.NewSnapshotId()
|
||||
if b.params.IsReportingEnabled {
|
||||
b.rrSnapshotId = b.rtpStats.NewSnapshotId()
|
||||
@@ -455,10 +454,9 @@ func (b *BufferBase) setupRTPStats(clockRate uint32) {
|
||||
}
|
||||
|
||||
if b.params.IsOOBSequenceNumber {
|
||||
b.rtpStatsLite = rtpstats.NewRTPStatsReceiverLite(rtpstats.RTPStatsParams{
|
||||
ClockRate: clockRate,
|
||||
Logger: b.logger,
|
||||
})
|
||||
b.rtpStatsLite = rtpstats.NewRTPStatsReceiverLite(rtpstats.RTPStatsParams{})
|
||||
b.rtpStatsLite.SetClockRate(clockRate)
|
||||
|
||||
b.liteStatsSnapshotId = b.rtpStatsLite.NewSnapshotLiteId()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user