对其他音频的支持

This commit is contained in:
langhuihui
2020-09-20 15:54:27 +08:00
parent 7f40078b50
commit 02f3e91085
5 changed files with 30 additions and 12 deletions

View File

@@ -231,10 +231,10 @@ func (client *RTSP) requestStream() (err error) {
client.Conn.timeout = 0 // UDP ignore timeout
}
case "audio":
if len(sdpInfo.Config) < 2 {
Printf("Setup audio err codec not support: %s", client.ASdp.Codec)
} else {
if len(sdpInfo.Config) > 0 {
client.WriteASC(sdpInfo.Config)
}else{
client.setAudioFormat()
}
if client.TransType == TRANS_TYPE_TCP {
headers["Transport"] = fmt.Sprintf("RTP/AVP/TCP;unicast;interleaved=%d-%d", client.aRTPChannel, client.aRTPControlChannel)
@@ -337,9 +337,6 @@ func (client *RTSP) startStream() {
pack = &RTPPack{
Type: RTP_TYPE_AUDIO,
}
if client.ASdp.Codec != "aac" {
continue
}
case client.aRTPControlChannel:
pack = &RTPPack{
Type: RTP_TYPE_AUDIOCONTROL,