将每次读的4096个字节写进文件,播放的时候很大的杂音
char *out = "audio.pcm";
FILE *outFile = fopen(out, "wb+");
while (((ret=av_read_frame(fmt_ctx, &pkt))==0||ret==-35)&&status==1) {
if(ret==-35) {
continue;
}
av_log(NULL, AV_LOG_INFO,
"packet size is %d(%p)\n",
pkt.size, pkt.data);
fwrite(pkt.data, pkt.size, 1, outFile);
fflush(outFile);
av_packet_unref(&pkt);
}
fclose(outFile);