Use sample frames when handling the buffer length