mirror of
https://github.com/kerberos-io/agent.git
synced 2025-09-26 20:21:22 +08:00
Update machinery/src/capture/gortsplib.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:

committed by
GitHub

parent
086080a431
commit
3a0f8de400
@@ -1044,11 +1044,8 @@ func (d *Decoder) Close() {
|
||||
}
|
||||
|
||||
func (d *Decoder) decode(nalu []byte) (image.YCbCr, error) {
|
||||
// Create a new slice with start code + nalu data
|
||||
// This avoids the cgo pointer issue by creating a fresh slice each time
|
||||
naluWithStartCode := make([]byte, len(nalu)+4)
|
||||
copy(naluWithStartCode[:4], []byte{0x00, 0x00, 0x00, 0x01})
|
||||
copy(naluWithStartCode[4:], nalu)
|
||||
// Prepend the NALU start code using a helper function
|
||||
naluWithStartCode := prependNALUStartCode(nalu)
|
||||
|
||||
// send NALU to decoder
|
||||
var avPacket C.AVPacket
|
||||
|
Reference in New Issue
Block a user