Log only on change and also don't log layer for audio (#934)
This commit is contained in:
@@ -610,7 +610,6 @@ func (d *DownTrack) WritePaddingRTP(bytesToSend int) int {
|
||||
|
||||
// Mute enables or disables media forwarding
|
||||
func (d *DownTrack) Mute(muted bool) {
|
||||
d.logger.Infow("setting mute", "muted", muted)
|
||||
changed, maxLayers := d.forwarder.Mute(muted)
|
||||
if !changed {
|
||||
return
|
||||
@@ -708,7 +707,6 @@ func (d *DownTrack) CloseWithFlush(flush bool) {
|
||||
}
|
||||
|
||||
func (d *DownTrack) SetMaxSpatialLayer(spatialLayer int32) {
|
||||
d.logger.Infow("setting max spatial layer", "layer", spatialLayer)
|
||||
changed, maxLayers, currentLayers := d.forwarder.SetMaxSpatialLayer(spatialLayer)
|
||||
if !changed {
|
||||
return
|
||||
|
||||
@@ -273,18 +273,19 @@ func (f *Forwarder) SeedState(state ForwarderState) {
|
||||
f.started = true
|
||||
}
|
||||
|
||||
func (f *Forwarder) Mute(val bool) (bool, VideoLayers) {
|
||||
func (f *Forwarder) Mute(muted bool) (bool, VideoLayers) {
|
||||
f.lock.Lock()
|
||||
defer f.lock.Unlock()
|
||||
|
||||
if f.muted == val {
|
||||
if f.muted == muted {
|
||||
return false, f.maxLayers
|
||||
}
|
||||
|
||||
f.muted = val
|
||||
f.logger.Infow("setting mute", "muted", muted)
|
||||
f.muted = muted
|
||||
|
||||
// resync when muted so that sequence numbers do not jump on unmute
|
||||
if val {
|
||||
if muted {
|
||||
f.resyncLocked()
|
||||
}
|
||||
|
||||
@@ -306,6 +307,7 @@ func (f *Forwarder) SetMaxSpatialLayer(spatialLayer int32) (bool, VideoLayers, V
|
||||
return false, f.maxLayers, f.currentLayers
|
||||
}
|
||||
|
||||
f.logger.Infow("setting max spatial layer", "layer", spatialLayer)
|
||||
f.maxLayers.Spatial = spatialLayer
|
||||
|
||||
return true, f.maxLayers, f.currentLayers
|
||||
|
||||
Reference in New Issue
Block a user