rtsp: conn.Close() before retry dialing with backchannel=false
This commit is contained in:
+4
-2
@@ -5,14 +5,15 @@ import (
|
|||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/AlexxIT/go2rtc/pkg/core"
|
|
||||||
"github.com/AlexxIT/go2rtc/pkg/tcp"
|
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/AlexxIT/go2rtc/pkg/core"
|
||||||
|
"github.com/AlexxIT/go2rtc/pkg/tcp"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewClient(uri string) *Conn {
|
func NewClient(uri string) *Conn {
|
||||||
@@ -309,6 +310,7 @@ func (c *Conn) SetupMedia(media *core.Media, first bool) (byte, error) {
|
|||||||
// some Dahua/Amcrest cameras fail here because two simultaneous
|
// some Dahua/Amcrest cameras fail here because two simultaneous
|
||||||
// backchannel connections
|
// backchannel connections
|
||||||
if c.Backchannel {
|
if c.Backchannel {
|
||||||
|
c.Close()
|
||||||
c.Backchannel = false
|
c.Backchannel = false
|
||||||
if err := c.Dial(); err != nil {
|
if err := c.Dial(); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
|
|||||||
Reference in New Issue
Block a user