mirror of
https://github.com/stryan/mumble-discord-bridge.git
synced 2024-11-23 05:45:41 -05:00
attempt to set niceness
This commit is contained in:
parent
f8518176d5
commit
a735f3f62f
@ -163,6 +163,7 @@ func discordReceivePCM(v *discordgo.VoiceConnection, die chan bool) {
|
|||||||
case fromDiscordMap[p.SSRC].pcm <- p.PCM[0:480]:
|
case fromDiscordMap[p.SSRC].pcm <- p.PCM[0:480]:
|
||||||
default:
|
default:
|
||||||
log.Println("fromDiscordMap buffer full. Dropping packet")
|
log.Println("fromDiscordMap buffer full. Dropping packet")
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
select {
|
select {
|
||||||
case fromDiscordMap[p.SSRC].pcm <- p.PCM[480:960]:
|
case fromDiscordMap[p.SSRC].pcm <- p.PCM[480:960]:
|
||||||
|
9
main.go
9
main.go
@ -9,6 +9,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/bwmarrin/discordgo"
|
"github.com/bwmarrin/discordgo"
|
||||||
@ -88,6 +89,12 @@ func main() {
|
|||||||
log.Fatalln("missing discord cid")
|
log.Fatalln("missing discord cid")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Attempt to set the nice value of the process
|
||||||
|
err := syscall.Setpriority(syscall.PRIO_PROCESS, os.Getpid(), -5)
|
||||||
|
if err != nil {
|
||||||
|
log.Println("Unable to set priority. ", err)
|
||||||
|
}
|
||||||
|
|
||||||
// DISCORD Setup
|
// DISCORD Setup
|
||||||
|
|
||||||
discord, err := discordgo.New("Bot " + *discordToken)
|
discord, err := discordgo.New("Bot " + *discordToken)
|
||||||
@ -131,7 +138,7 @@ func main() {
|
|||||||
tlsConfig.InsecureSkipVerify = true
|
tlsConfig.InsecureSkipVerify = true
|
||||||
}
|
}
|
||||||
|
|
||||||
mumble, err := gumble.DialWithDialer(new(net.Dialer),*mumbleAddr+":"+strconv.Itoa(*mumblePort),config, &tlsConfig)
|
mumble, err := gumble.DialWithDialer(new(net.Dialer), *mumbleAddr+":"+strconv.Itoa(*mumblePort), config, &tlsConfig)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user