mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 07:06:58 +08:00
client: allow to publish tracks with pre-existing control attribute (#48)
This commit is contained in:
@@ -1090,14 +1090,17 @@ func (cc *ClientConn) doAnnounce(u *base.URL, tracks Tracks) (*base.Response, er
|
||||
// (tested with ffmpeg and gstreamer)
|
||||
baseURL := u.Clone()
|
||||
|
||||
// set id, base url and control attribute on tracks
|
||||
// set ID, base URL, control attribute of tracks
|
||||
for i, t := range tracks {
|
||||
t.ID = i
|
||||
t.BaseURL = baseURL
|
||||
t.Media.Attributes = append(t.Media.Attributes, psdp.Attribute{
|
||||
Key: "control",
|
||||
Value: "trackID=" + strconv.FormatInt(int64(i), 10),
|
||||
})
|
||||
|
||||
if !t.hasControlAttribute() {
|
||||
t.Media.Attributes = append(t.Media.Attributes, psdp.Attribute{
|
||||
Key: "control",
|
||||
Value: "trackID=" + strconv.FormatInt(int64(i), 10),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
res, err := cc.do(&base.Request{
|
||||
|
Reference in New Issue
Block a user