Change go version to 1.20 for Windows 7 support

This commit is contained in:
Alex X
2024-09-01 15:56:19 +03:00
parent afc8f4fdf6
commit 2311d5eabe
12 changed files with 74 additions and 21 deletions
+1 -2
View File
@@ -10,7 +10,6 @@ import (
"net/url"
"os"
"os/exec"
"slices"
"strings"
"sync"
"time"
@@ -230,7 +229,7 @@ func trimSpace(b []byte) []byte {
func setRemoteInfo(info core.Info, source string, args []string) {
info.SetSource(source)
if i := slices.Index(args, "-i"); i > 0 && i < len(args)-1 {
if i := core.Index(args, "-i"); i > 0 && i < len(args)-1 {
rawURL := args[i+1]
if u, err := url.Parse(rawURL); err == nil && u.Host != "" {
info.SetRemoteAddr(u.Host)
+1 -2
View File
@@ -2,7 +2,6 @@ package ffmpeg
import (
"net/url"
"slices"
"strings"
"github.com/AlexxIT/go2rtc/internal/api"
@@ -44,7 +43,7 @@ func Init() {
return "", err
}
args := parseArgs(url[7:])
if slices.Contains(args.Codecs, "auto") {
if core.Contains(args.Codecs, "auto") {
return "", nil // force call streams.HandleFunc("ffmpeg")
}
return "exec:" + args.String(), nil
+3 -3
View File
@@ -2,10 +2,10 @@ package webrtc
import (
"net"
"slices"
"strings"
"github.com/AlexxIT/go2rtc/internal/api/ws"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/AlexxIT/go2rtc/pkg/webrtc"
pion "github.com/pion/webrtc/v3"
)
@@ -75,14 +75,14 @@ func FilterCandidate(candidate *pion.ICECandidate) bool {
// host candidate should be in the hosts list
if candidate.Typ == pion.ICECandidateTypeHost && filters.Candidates != nil {
if !slices.Contains(filters.Candidates, candidate.Address) {
if !core.Contains(filters.Candidates, candidate.Address) {
return false
}
}
if filters.Networks != nil {
networkType := NetworkType(candidate.Protocol.String(), candidate.Address)
if !slices.Contains(filters.Networks, networkType) {
if !core.Contains(filters.Networks, networkType) {
return false
}
}