19 lines
300 B
Go
19 lines
300 B
Go
//go:build cgo
|
|
|
|
package packetizer
|
|
|
|
/*
|
|
#cgo CFLAGS: -march=native -Ofast -std=c99
|
|
#include "ogg_crc.h"
|
|
*/
|
|
import "C"
|
|
import (
|
|
"runtime"
|
|
"unsafe"
|
|
)
|
|
|
|
func oggCrc32(p []byte) uint32 {
|
|
defer runtime.KeepAlive(p)
|
|
return uint32(C.ogg_crc32((*C.uint8_t)(unsafe.SliceData(p)), C.size_t(len(p))))
|
|
}
|