mirror of https://github.com/jetkvm/kvm.git
Make RestartAudioOutput async to prevent RPC hanging
Consistent with other audio toggle functions, restart now happens asynchronously to avoid blocking the RPC caller.
This commit is contained in:
parent
edd06e2346
commit
3cd5bdd16c
7
audio.go
7
audio.go
|
|
@ -339,7 +339,12 @@ func RestartAudioOutput() error {
|
|||
|
||||
audioLogger.Info().Msg("Restarting audio output")
|
||||
stopOutputAudio()
|
||||
return startAudio()
|
||||
go func() {
|
||||
if err := startAudio(); err != nil {
|
||||
audioLogger.Error().Err(err).Msg("Failed to restart audio output")
|
||||
}
|
||||
}()
|
||||
return nil
|
||||
}
|
||||
|
||||
func handleInputTrackForSession(track *webrtc.TrackRemote) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue