我在使用opus-codec时遇到了一些麻烦。
opus_encoder_create()返回一个空指针并抛出一个OPUS_BAD_ARG错误
OpusEncoder * m_enc;
m_enc = opus_encoder_create(44100, 2, OPUS_APPLICATION_VOIP, &this->m_error);
这是我用gdb获得的:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000001fa4
opus_encode_float (st=0x0, pcm=0x100717e20, frame_size=8, data=0x100840c00 "", out_data_bytes=4000) at opus_encoder.c:581
581 st->rangeFinal = 0;
(gdb) bt
#0 opus_encode_float (st=0x0, pcm=0x100717e20, frame_size=8, data=0x100840c00 "", out_data_bytes=4000) at opus_encoder.c:581
#1 0x0000000100002b1d in Encoder::Encode (this=0x7fff5fbffa70, audioFrame=0x100717e20, frameSize=8) at Encoder.cpp:39
#2 0x000000010000192c in main () at main.cpp:101
任何想法为什么?感谢。
答案 0 :(得分:6)