mirror of
https://github.com/aler9/gortsplib
synced 2025-10-24 15:43:18 +08:00
client: fix reading with multicast
This commit is contained in:
@@ -448,7 +448,7 @@ func (cc *ClientConn) runBackground() {
|
|||||||
return cc.runBackgroundPlayTCP()
|
return cc.runBackgroundPlayTCP()
|
||||||
}
|
}
|
||||||
|
|
||||||
if *cc.protocol == ClientProtocolUDP || *cc.protocol == ClientProtocolMulticast {
|
if *cc.protocol == ClientProtocolUDP {
|
||||||
return cc.runBackgroundRecordUDP()
|
return cc.runBackgroundRecordUDP()
|
||||||
}
|
}
|
||||||
return cc.runBackgroundRecordTCP()
|
return cc.runBackgroundRecordTCP()
|
||||||
@@ -1636,13 +1636,14 @@ func (cc *ClientConn) WriteFrame(trackID int, streamType StreamType, payload []b
|
|||||||
cc.tracks[trackID].rtcpSender.ProcessFrame(now, streamType, payload)
|
cc.tracks[trackID].rtcpSender.ProcessFrame(now, streamType, payload)
|
||||||
}
|
}
|
||||||
|
|
||||||
if *cc.protocol == ClientProtocolUDP {
|
switch *cc.protocol {
|
||||||
|
case ClientProtocolUDP, ClientProtocolMulticast:
|
||||||
if streamType == StreamTypeRTP {
|
if streamType == StreamTypeRTP {
|
||||||
return cc.tracks[trackID].udpRTPListener.write(payload)
|
return cc.tracks[trackID].udpRTPListener.write(payload)
|
||||||
}
|
}
|
||||||
return cc.tracks[trackID].udpRTCPListener.write(payload)
|
return cc.tracks[trackID].udpRTCPListener.write(payload)
|
||||||
}
|
|
||||||
|
|
||||||
|
default: // TCP
|
||||||
cc.tcpWriteMutex.Lock()
|
cc.tcpWriteMutex.Lock()
|
||||||
defer cc.tcpWriteMutex.Unlock()
|
defer cc.tcpWriteMutex.Unlock()
|
||||||
|
|
||||||
@@ -1652,4 +1653,5 @@ func (cc *ClientConn) WriteFrame(trackID int, streamType StreamType, payload []b
|
|||||||
StreamType: streamType,
|
StreamType: streamType,
|
||||||
Payload: payload,
|
Payload: payload,
|
||||||
}.Write(cc.bw)
|
}.Write(cc.bw)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user