fix regression #639, #638.

This commit is contained in:
Miroslav Šedivý
2026-04-10 10:58:34 +02:00
parent c9b184c1ae
commit a545115156
+10 -4
View File
@@ -401,8 +401,11 @@ func (peer *WebRTCPeerCtx) SetVideo(r types.PeerVideoRequest) error {
// send video signal if modified // send video signal if modified
if modified { if modified {
// in goroutine because of mutex and we don't want to block go func() {
go peer.session.Send(event.SIGNAL_VIDEO, peer.Video()) // in goroutine because of mutex and we don't want to block
resolvedVideo := peer.Video()
peer.session.Send(event.SIGNAL_VIDEO, resolvedVideo)
}()
} }
return nil return nil
@@ -453,8 +456,11 @@ func (peer *WebRTCPeerCtx) SetAudio(r types.PeerAudioRequest) error {
// send video signal if modified // send video signal if modified
if modified { if modified {
// in goroutine because of mutex and we don't want to block go func() {
go peer.session.Send(event.SIGNAL_AUDIO, peer.Audio()) // in goroutine because of mutex and we don't want to block
resolvedAudio := peer.Audio()
peer.session.Send(event.SIGNAL_AUDIO, resolvedAudio)
}()
} }
return nil return nil