ffmpeg; check return code of avcodec_send_frame when flushing encoders