2024-04-07 12:40:09 CST W14D0

This commit is contained in:
aggresss
2024-04-07 12:40:09 +08:00
parent 3bf72b60e0
commit 4d6f80cb09
33 changed files with 2133 additions and 893 deletions

View File

@@ -166,12 +166,12 @@ func main() {
if ret := ffmpeg.AvFrameMakeWritable(frame); ret < 0 {
os.Exit(1)
}
samples := unsafe.Slice((*uint16)(unsafe.Pointer(frame.GetData()[0])), avctx.GetFrameSize()*avctx.GetChannels())
samples := unsafe.Slice((*uint16)(unsafe.Pointer(frame.GetData()[0])), avctx.GetFrameSize()*avctx.GetChLayoutAddr().GetNbChannels())
for j := 0; j < int(avctx.GetFrameSize()); j++ {
samples[2*j] = (uint16)(math.Sin(t) * 10000)
for k := 1; k < int(avctx.GetChannels()); k++ {
for k := 1; k < int(avctx.GetChLayoutAddr().GetNbChannels()); k++ {
samples[2*j+k] = samples[2*j]
}
t += tincr