Skip to content

Commit fc9b5fe

Browse files
committed
Remove Audio Simulcast code
1 parent a46d37e commit fc9b5fe

File tree

2 files changed

+8
-31
lines changed

2 files changed

+8
-31
lines changed

internal/webrtc/sessions/whep/whep.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -147,19 +147,6 @@ func (w *WHEPSession) updateVideoBitrateLocked(now time.Time) {
147147
w.videoBitrateWindowBytes = w.VideoBytesWritten
148148
}
149149

150-
func (w *WHEPSession) GetAudioLayerOrDefault(defaultLayer string) string {
151-
w.AudioLock.Lock()
152-
defer w.AudioLock.Unlock()
153-
154-
currentLayer, _ := w.AudioLayerCurrent.Load().(string)
155-
if currentLayer != "" {
156-
return currentLayer
157-
}
158-
159-
w.AudioLayerCurrent.Store(defaultLayer)
160-
return defaultLayer
161-
}
162-
163150
func (w *WHEPSession) GetVideoLayerOrDefault(defaultLayer string) string {
164151
w.VideoLock.Lock()
165152
defer w.VideoLock.Unlock()

internal/webrtc/sessions/whip/writers.go

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ func (w *WHIPSession) audioWriter(remoteTrack *webrtc.TrackRemote, streamKey str
6666
}
6767

6868
for _, whepSession := range sessions {
69-
if whepSession.GetAudioLayerOrDefault(id) == id {
70-
whepSession.SendAudioPacket(packet)
71-
}
69+
whepSession.SendAudioPacket(packet)
7270
}
7371
}
7472
}
@@ -184,28 +182,20 @@ func (w *WHIPSession) videoWriter(remoteTrack *webrtc.TrackRemote, streamKey str
184182
sessions = sessionsAny.(map[string]*whep.WHEPSession)
185183
}
186184

187-
sendVideoPacketToWHEP(
188-
id,
189-
sessions,
190-
codecs.TrackPacket{
185+
for _, whepSession := range sessions {
186+
if whepSession.GetVideoLayerOrDefault(id) != id {
187+
continue
188+
}
189+
190+
whepSession.SendVideoPacket(codecs.TrackPacket{
191191
Layer: id,
192192
Packet: rtpPkt,
193193
Codec: codec,
194194
IsKeyframe: isKeyframe,
195195
TimeDiff: timeDiff,
196196
SequenceDiff: sequenceDiff,
197-
},
198-
)
199-
}
200-
}
201-
202-
func sendVideoPacketToWHEP(id string, sessions map[string]*whep.WHEPSession, packet codecs.TrackPacket) {
203-
for _, whepSession := range sessions {
204-
if whepSession.GetVideoLayerOrDefault(id) != id {
205-
continue
197+
})
206198
}
207-
208-
whepSession.SendVideoPacket(packet)
209199
}
210200
}
211201

0 commit comments

Comments
 (0)