int ret;  ret = avctx->codec->encode(avctx, buf, buf_size, (void *)samples); avctx->frame_number++; return ret;
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;
int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,                          const short *samples){    int ret;    ret = avctx->codec->encode(avctx, buf, buf_size, (void *)samples);    avctx->frame_number++;    return ret;}