int out_size;
void write_audio_frame(AVFormatContext *oc, AVStream *st){    int out_size;    AVCodecContext *c;    AVPacket pkt;    av_init_packet(&pkt);        c = &st->codec;    get_audio_frame(samples, audio_input_frame_size, c->channels);    pkt.size= avcodec_encode_audio(c, audio_outbuf, audio_outbuf_size, samples);    pkt.pts= c->coded_frame->pts;    pkt.flags |= PKT_FLAG_KEY;    pkt.stream_index= st->index;    pkt.data= audio_outbuf;    /* write the compressed frame in the media file */    if (av_write_frame(oc, &pkt) != 0) {        fprintf(stderr, "Error while writing audio frame\n");        exit(1);    }}