FILE *pFile = fopen("./dec.pcm","wb+");
int got_frame = 0;
AVFrame frame;
ret = avcodec_decode_audio4(m_pAudioCodecCtx, &frame, &got_frame, &pkt);
if (ret < 0) {
printf("ERROR: decoding audio frame\n");
return -1;
}
if(got_frame) {
int plane_size;
int data_size = av_samples_get_buffer_size(&plane_size,
m_pAudioCodecCtx->channels, frame.nb_samples,
m_pAudioCodecCtx->sample_fmt, 1);
fwrite(frame.extended_data[0],1,plane_size,pFile);
}