Skip to content

Commit

Permalink
avoid returning partial RTP-Info header, omit seq/rtptime if needed (#…
Browse files Browse the repository at this point in the history
…568)

* avoid returning partial RTP-Info header, omit seq/rtptime if needed

* adjust test to align with new behavior of RTP-Info header
  • Loading branch information
Fusl committed May 9, 2024
1 parent 877771e commit 9f6428b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
7 changes: 7 additions & 0 deletions server_play_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1901,6 +1901,13 @@ func TestServerPlayAdditionalInfos(t *testing.T) {
SequenceNumber: uint16Ptr(557),
Timestamp: (*rtpInfo)[0].Timestamp,
},
&headers.RTPInfoEntry{
URL: (&base.URL{
Scheme: "rtsp",
Host: "localhost:8554",
Path: mustParseURL((*rtpInfo)[1].URL).Path,
}).String(),
},
}, rtpInfo)
require.Equal(t, []*uint32{
uint32Ptr(96342362),
Expand Down
19 changes: 10 additions & 9 deletions server_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,16 @@ func generateRTPInfo(

for _, sm := range setuppedMediasOrdered {
entry := setuppedStream.rtpInfoEntry(sm.media, now)
if entry != nil {
entry.URL = (&base.URL{
Scheme: u.Scheme,
Host: u.Host,
Path: setuppedPath + "/trackID=" +
strconv.FormatInt(int64(setuppedStream.streamMedias[sm.media].trackID), 10),
}).String()
ri = append(ri, entry)
}
if entry == nil {
entry = &headers.RTPInfoEntry{}
}
entry.URL = (&base.URL{
Scheme: u.Scheme,
Host: u.Host,
Path: setuppedPath + "/trackID=" +
strconv.FormatInt(int64(setuppedStream.streamMedias[sm.media].trackID), 10),
}).String()
ri = append(ri, entry)
}

if len(ri) == 0 {
Expand Down

0 comments on commit 9f6428b

Please sign in to comment.