if(buf_size < FF_MIN_BUFFER_SIZE && 0){ av_log(avctx, AV_LOG_ERROR, "buffer smaller then minimum size\n"); return -1; }
int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,                          const short *samples){    if((avctx->codec->capabilities & CODEC_CAP_DELAY) || samples){        int ret = avctx->codec->encode(avctx, buf, buf_size, (void *)samples);        avctx->frame_number++;        return ret;    }else        return 0;}