2023-10-24 21:24:55 CST W43D2

This commit is contained in:
aggresss
2023-10-24 21:24:55 +08:00
parent e163918619
commit 4329c27b55
47 changed files with 3577 additions and 165 deletions

View File

@@ -60,9 +60,10 @@ func decode(decCtx *ffmpeg.AVCodecContext, pkt *ffmpeg.AVPacket, frame *ffmpeg.A
fmt.Fprintf(os.Stderr, "Failed to calculate data size\n")
os.Exit(1)
}
data := ffmpeg.SliceSlice(&frame.GetData()[0], decCtx.GetChannels(), frame.GetNbSamples()*dataSize)
for i := int32(0); i < frame.GetNbSamples(); i++ {
for ch := 0; ch < int(decCtx.GetChannels()); ch++ {
outfile.Write(ffmpeg.ByteSliceWithOffset(frame.GetData()[ch], dataSize*i, dataSize))
outfile.Write(data[ch][dataSize*i : dataSize*(i+1)])
}
}
}