mirror of
https://github.com/qrtc/ffmpeg-dev-go.git
synced 2025-10-04 23:33:15 +08:00
2023-10-24 21:24:55 CST W43D2
This commit is contained in:
@@ -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)])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user