Skip to content

Commit

Permalink
rtmp: support empty H264 access units fro DJI (#2375)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 committed Sep 24, 2023
1 parent f1e28d0 commit 4e60e5c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions internal/rtmp/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,23 +480,29 @@ func (r *Reader) OnDataH265(cb OnDataH26xFunc) {
return fmt.Errorf("unable to decode AVCC: %v", err)
}

cb(msg.DTS+msg.PTSDelta, au)
if au != nil {
cb(msg.DTS+msg.PTSDelta, au)
}

case *message.ExtendedFramesX:
au, err := h264.AVCCUnmarshal(msg.Payload)
if err != nil {
return fmt.Errorf("unable to decode AVCC: %v", err)
}

cb(msg.DTS, au)
if au != nil {
cb(msg.DTS, au)
}

case *message.ExtendedCodedFrames:
au, err := h264.AVCCUnmarshal(msg.Payload)
if err != nil {
return fmt.Errorf("unable to decode AVCC: %v", err)
}

cb(msg.DTS+msg.PTSDelta, au)
if au != nil {
cb(msg.DTS+msg.PTSDelta, au)
}
}

return nil
Expand Down Expand Up @@ -528,7 +534,9 @@ func (r *Reader) OnDataH264(cb OnDataH26xFunc) {
return fmt.Errorf("unable to decode AVCC: %v", err)
}

cb(msg.DTS+msg.PTSDelta, au)
if au != nil {
cb(msg.DTS+msg.PTSDelta, au)
}
}
}

Expand Down

0 comments on commit 4e60e5c

Please sign in to comment.