+ /* if we already got an undersized frame, that must have been the last */
+ if (avctx->internal->last_audio_frame) {
+ av_log(avctx, AV_LOG_ERROR, "frame_size (%d) was not respected for a non-last frame (avcodec_encode_audio2)\n", avctx->frame_size);
+ ret = AVERROR(EINVAL);
+ goto end;
+ }
+
+ if (frame->nb_samples < avctx->frame_size) {