mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-09-27 01:15:52 +08:00
fix: rtp fu-a format check
This commit is contained in:
@@ -106,10 +106,10 @@ rtsp:
|
||||
# pull:
|
||||
# live/test: rtsp://admin:1qaz2wsx3EDC@58.212.158.30/Streaming/Channels/101
|
||||
# live/test: rtsp://admin:1qaz2wsx3EDC@localhost:8554/live/test
|
||||
webrtc:
|
||||
publish:
|
||||
pubaudio: false
|
||||
port: udp:9000-9100
|
||||
# webrtc:
|
||||
# publish:
|
||||
# pubaudio: false
|
||||
# port: udp:9000-9100
|
||||
snap:
|
||||
enable: false
|
||||
onpub:
|
||||
|
@@ -404,10 +404,10 @@ func (r *VideoFrame) Demux() (err error) {
|
||||
naluType.Parse(b1)
|
||||
nalu.PushOne([]byte{naluType.Or(b0 & 0x60)})
|
||||
}
|
||||
if nalu.Size > 0 {
|
||||
if nalu != nil && nalu.Size > 0 {
|
||||
nalu.PushOne(packet.Payload[offset:])
|
||||
if util.Bit1(b1, 1) {
|
||||
// 结束位
|
||||
nalu = nil
|
||||
}
|
||||
} else {
|
||||
continue
|
||||
@@ -455,9 +455,13 @@ func (r *VideoFrame) Demux() (err error) {
|
||||
nalu = nalus.GetNextPointer()
|
||||
nalu.PushOne([]byte{first3[0]&0b10000001 | (naluType << 1), first3[1]})
|
||||
}
|
||||
nalu.PushOne(buffer)
|
||||
if util.Bit1(fuHeader, 1) {
|
||||
// 结束标志
|
||||
if nalu != nil && nalu.Size > 0 {
|
||||
nalu.PushOne(buffer)
|
||||
if util.Bit1(fuHeader, 1) {
|
||||
nalu = nil
|
||||
}
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
default:
|
||||
return fmt.Errorf("unsupported nalu type %d", t)
|
||||
|
Reference in New Issue
Block a user