Merge pull request #6 from joestarzxh/master

[fix]rtsp转rtmp腾讯X5播放器无法播放H265
pull/54/head
joestarzxh 4 years ago committed by GitHub
commit 299e33df01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -142,6 +142,7 @@ func AVPacket2RTMPMsg(pkt base.AVPacket) (msg base.RTMPMsg, err error) {
// TODO chef: 这段代码应该放在更合适的地方或者在AVPacket中标识是否包含关键帧
for i := 0; i != len(pkt.Payload); {
naluSize := int(bele.BEUint32(pkt.Payload[i:]))
switch pkt.PayloadType {
case base.AVPacketPTAVC:
t := avc.ParseNALUType(pkt.Payload[i+4])

@ -120,7 +120,7 @@ func ParseSDP2LogicContext(b []byte) (LogicContext, error) {
if md.AFmtPBase != nil {
ret.ASC, err = ParseASC(md.AFmtPBase)
if err != nil {
nazalog.Warnf("asc Parse error.")
return ret, err
}
} else {
nazalog.Warnf("aac afmtp not exist.")
@ -140,7 +140,7 @@ func ParseSDP2LogicContext(b []byte) (LogicContext, error) {
if md.AFmtPBase != nil {
ret.SPS, ret.PPS, err = ParseSPSPPS(md.AFmtPBase)
if err != nil {
nazalog.Warnf("avc sps pps Parse error.")
return ret, err
}
} else {
nazalog.Warnf("avc afmtp not exist.")
@ -150,7 +150,7 @@ func ParseSDP2LogicContext(b []byte) (LogicContext, error) {
if md.AFmtPBase != nil {
ret.VPS, ret.SPS, ret.PPS, err = ParseVPSSPSPPS(md.AFmtPBase)
if err != nil {
nazalog.Warnf("hevc vps sps pps Parse error.")
return ret, err
}
} else {
nazalog.Warnf("hevc afmtp not exist.")

@ -184,6 +184,7 @@ func ParseAFmtPBase(s string) (ret AFmtPBase, err error) {
pp = strings.TrimSpace(pp)
kv := strings.SplitN(pp, "=", 2)
if len(kv) != 2 {
err = ErrSDP
return
}
ret.Parameters[kv[0]] = kv[1]

Loading…
Cancel
Save