Fix RTSP server handler for some Cloud clients #347

This commit is contained in:
Alexey Khit
2023-04-19 17:09:02 +03:00
parent 5fe07aeea0
commit 55fdf1a647
2 changed files with 7 additions and 2 deletions
+4
View File
@@ -136,6 +136,10 @@ func MarshalSDP(name string, medias []*Media) ([]byte, error) {
}
md.WithCodec(codec.PayloadType, name, codec.ClockRate, codec.Channels, codec.FmtpLine)
if media.ID != "" {
md.WithValueAttribute("control", media.ID)
}
sd.MediaDescriptions = append(sd.MediaDescriptions, md)
}
+3 -2
View File
@@ -40,8 +40,9 @@ func (c *Conn) Accept() error {
if !c.auth.Validate(req) {
res := &tcp.Response{
Status: "401 Unauthorized",
Header: map[string][]string{"Www-Authenticate": {`Basic realm="go2rtc"`}},
Status: "401 Unauthorized",
Header: map[string][]string{"Www-Authenticate": {`Basic realm="go2rtc"`}},
Request: req,
}
if err = c.WriteResponse(res); err != nil {
return err