mirror of
https://github.com/livekit/livekit.git
synced 2026-08-28 23:01:19 +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:
@@ -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