@@ -141,20 +141,18 @@ func TestSource(t *testing.T) {
141141 defer strm .Close ()
142142
143143 var ur string
144- var cnf * conf.Path
144+ cnf := & conf.Path {
145+ RTSPUDPSourcePortRange : []uint {10000 , 65535 },
146+ }
145147
146148 if source != "tls" {
147149 ur = "rtsp://testuser:testpass@localhost:8555/teststream"
148150 var sp conf.RTSPTransport
149151 sp .UnmarshalJSON ([]byte (`"` + source + `"` )) //nolint:errcheck
150- cnf = & conf.Path {
151- RTSPTransport : sp ,
152- }
152+ cnf .RTSPTransport = sp
153153 } else {
154154 ur = "rtsps://testuser:testpass@localhost:8555/teststream"
155- cnf = & conf.Path {
156- SourceFingerprint : "33949E05FFFB5FF3E8AA16F8213A6251B4D9363804BA53233C4DA9A46D6F2739" ,
157- }
155+ cnf .SourceFingerprint = "33949E05FFFB5FF3E8AA16F8213A6251B4D9363804BA53233C4DA9A46D6F2739"
158156 }
159157
160158 p := & test.StaticSourceParent {}
@@ -286,7 +284,8 @@ func TestNoPassword(t *testing.T) {
286284 Context : ctx ,
287285 ResolvedSource : "rtsp://testuser:@127.0.0.1:8555/teststream" ,
288286 Conf : & conf.Path {
289- RTSPTransport : sp ,
287+ RTSPTransport : sp ,
288+ RTSPUDPSourcePortRange : []uint {10000 , 65535 },
290289 },
291290 })
292291 close (done )
@@ -362,7 +361,9 @@ func TestRange(t *testing.T) {
362361 require .NoError (t , err )
363362 defer strm .Close ()
364363
365- cnf := & conf.Path {}
364+ cnf := & conf.Path {
365+ RTSPUDPSourcePortRange : []uint {10000 , 65535 },
366+ }
366367
367368 switch ca {
368369 case "clock" :
@@ -496,7 +497,8 @@ func TestSkipBackChannel(t *testing.T) {
496497 Context : ctx ,
497498 ResolvedSource : "rtsp://127.0.0.1:8555/teststream" ,
498499 Conf : & conf.Path {
499- RTSPTransport : conf.RTSPTransport {Protocol : ptrOf (gortsplib .ProtocolTCP )},
500+ RTSPTransport : conf.RTSPTransport {Protocol : ptrOf (gortsplib .ProtocolTCP )},
501+ RTSPUDPSourcePortRange : []uint {10000 , 65535 },
500502 },
501503 })
502504 close (done )
@@ -571,7 +573,8 @@ func TestOnlyBackChannelsError(t *testing.T) {
571573 Context : ctx ,
572574 ResolvedSource : "rtsp://127.0.0.1:8555/teststream" ,
573575 Conf : & conf.Path {
574- RTSPTransport : conf.RTSPTransport {Protocol : ptrOf (gortsplib .ProtocolTCP )},
576+ RTSPTransport : conf.RTSPTransport {Protocol : ptrOf (gortsplib .ProtocolTCP )},
577+ RTSPUDPSourcePortRange : []uint {10000 , 65535 },
575578 },
576579 })
577580
0 commit comments