nareix / joy4

Golang audio/video library and streaming server
MIT License
2.68k stars 500 forks source link

struct AVFrame not found Channels #72

Closed qiu770 closed 6 years ago

qiu770 commented 6 years ago

This method requires access to the channels property in AVFrame, But I didn't find that property.

I looked up the documentation on Livav's website. There are no Channels in AVFrame.

Can you tell me how to solve this problem?

func audioFrameAssignToAVData(f C.AVFrame, frame av.AudioFrame) { frame.SampleCount = int(f.nb_samples) frame.Data = make([][]byte, int(f.channels)) for i := 0; i < int(f.channels); i++ { frame.Data[i] = C.GoBytes(unsafe.Pointer(f.data[i]), f.linesize[0]) } }

This code is on line 457 of audio.go

qiu770 commented 6 years ago

#